Article ID: 238786
Article Last Modified on 7/1/2004
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q238786
SUMMARY
At times it can be desirable to step through the code of a DCOM Server as it is being accessed by a remote client application. This article describes how to debug a DCOM server created with Visual Basic as it is being accessed by a client application on a second computer.
MORE INFORMATION
This article assumes that the reader already knows how to create a DCOM server application and how to distribute and install the client on a remote computer. See the REFERENCES section for more information.
The following steps discuss how to set up a client application and a DCOM server for remote access debugging.
- Create a DCOM Server, save the project and compile it.
- Create a client for your server. Save the project and compile it.
- Create the distribution files for the client.
- Install the client on a remote computer.
- Make all needed settings using Dcomcnfg on the client and server computers.
- Test the client with the compiled server to assure the DCOM connection is working fine.
- Close the client. You are now ready to start debugging.
- Assure the server is not running. You can use Task Manager for this purpose.
- Start Visual Basic and open your Server project.
- From the Project menu, select Properties and choose the Component Tab. Assure that Binary Compatibility is set.
- While still in Properties, select the Debugging tab. Check the Wait for components to be created option and click OK.
- Place breakpoints as required.
- Press F5 to run the server.
- Start the client.
- At this point, you should be running the Server in the Visual Basic IDE. The process will break as soon as a breakpoint is reached. You can now debug the server as any other application in the IDE.
- Once you close the client, the server will continue to be loaded in the IDE. To end the server, from the Run menu select End.
Important Security Issues
When your server is running in Visual Basic's IDE, it runs in the security context of Visual Basic. This means that the settings you have chosen for your server using Dcomcnfg are not effective at this time. The identity of the server at this point will be the interactive user. In addition, you cannot set access rights to Visual Basic. As a consequence, the only user that can access the server running in the IDE is the user that is logged on to the computer where the server is running. In other words, the user logged on to the computer where the client is running must be the same user that is logged on to the computer where the server is running.
REFERENCES
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
266717 How To Create a DCOM Client/Server Application by Using Visual Basic
267836 How To Create a DCOM Client/Server with Events by Using Visual Basic
268550 How To Use Dcomcnfg for a Visual Basic DCOM Client/Server Application
269330 How To Troubleshoot DCOM for Visual Basic Client/Server Applications
Keywords: kbhowto kbbug kbdcom kbdebug kbclientserver KB238786