Debugging Problems with Remote ApplicationsBe sure to debug the behavior of your remote application locally before installing it on a server and attempting remote access. Any time you recompile the application, it must be re-registered on the server and client machines, so you save a lot of time if you're sure the remote application is working correctly before you proceed to testing it for remote access.
After you've verified that your remote application runs correctly and can provide objects to other applications locally, install it on the server and register the application on the server and client machines. Next, run the client application that uses the object from the remote application. If you've done everything correctly, the two applications will run smoothly. If there are problems with the network connection, software installation, or application registration you will receive a remote automation error. Here are some of the common errors and a description of the possible causes:
Remote application can leave instances running on the server even after there are no more references from client applications. Be sure to check the Task Manager on the server to make sure the remote application ends when it should. These "phantom" instances can cause problems installing new versions of the remote application on the server, consume memory, and cause incorrect data to be returned to clients in some cases. If you notice that your remote application leaves instances running after all client applications have finished using it, check that the application is correctly de-referencing its own internal objects. The most common problem occurs when an application creates an instance of a hidden form, but doesn't destroy that instance when it is done. Listing 21.1 shows Class_Initialize and Class_Terminate event procedures that start an instance of a form and correctly destroy that instance before the object is destroyed[md]preventing a phantom instance. Listing 21.1 - Initializing and Terminating an Object that Displays a Form Private Sub Class_Initialize() ' Start an invisible instance of the form. frmLaunch.Hide End Sub Private Sub Class_Terminate() ' Be sure to close the form when you're done. Unload frmLaunch End Sub |
|||||||||||||||||||
![]() |
![]() |
|||