The information in this article applies to:
SUMMARY
The Visual Basic 5.0 debugger allows you to debug your code at design time
before you compile it into an .exe, .dll, or .ocx. If you are debugging
Visual Basic-created COM components, you can debug them out-of-process by
running multiple projects in the same instance of Visual Basic 5.0, or by
running separate instances of Visual Basic 5.0 with the client running in
one and the COM component running in the other.
MORE INFORMATION
The following steps assume that you already have a Visual Basic 5.0-created
Standard EXE (.exe), ActiveX DLL (.dll), ActiveX EXE (.exe), or ActiveX
Control (.ocx) that you want to debug.
then Go, or press the F5 key. When your Visual Basic compiled component reaches the line you set a breakpoint on, it will stop in Visual C++ 5.0 and allow you to perform normal debug operations. 4b. ActiveX EXE, DLL, or OCX: It is a little different for DLLs in that you have to specify an exe to debug with. To do this, from the Project menu select Settings, and then click the Debug tab. In the Executable for debug session text box specify the .exe file that references your .dll. Now follow step 4a which will launch your executable and your .dll and the Visual C++ 5.0 debugger will come up where you set the breakpoint in your .dll. 4c. ActiveX DLL Running Under Microsoft Transaction Server (MTS): To set this up, select Settings from the Visual C++ 5.0 Project menu, and then click the Debug tab. In the Executable for debug session text box, specify MTX.EXE. Then, in the Program arguments text box place /p:{00000000-0000- 0000-0000- 000000000000} where you would replace the 0's with the actual MTS Package ID. The Package ID can be obtained by examining the properties of your package in the Transaction Server Explorer. Following step 4a above which will launch MTX.EXE and your .dll. Now run the base client .exe that makes a call into your COM component running under MTS and the Visual C++ 5.0 debugger will come up where you set the breakpoint in your .dll. The following are additional notes when debugging under MTS: A. Is the dll being called on the system path? B. Have you accidentally re-registered your com object's dll, thereby wiping out the MTS-alterations to the registry? C. Might you have multiple copies of your com object's dll laying around, and you're setting breakpoints in the one that doesn't get loaded? D. Similarly to C, might you have multiple copies of your non-com dll laying around? E. There was one seemingly very stupid trick which was that you should copy your DLL with symbolic Information to the MTS directory and from there add that DLL as a package to the MTS explorer. If you do not do this, symbolic debugging inside the MTS component does not work. Also, make sure you kill all running mtx.exe's before starting up your copy in the debugger. When you start it up, does it run or does it shutdown immediately? Note any event log messages logged by MTS. To start from a safe starting point, you might want to completely delete your application, then recreate it, reinstall your component's dll, etc. 4d. ActiveX DLL Running Under Internet Information Server (IIS): Because IIS runs as an NT Service, you will need to give yourself permission to act as part of the operation system. To do this, go to NT Administrative Tools and select User Manager. If you are using User Manager for Domains in NT Server, make sure you have selected your machine name as the Domain from the File menu. Then, choose User Rights from the Policies menu. In the User Rights dialog box, place a check next to Show Advanced User Rights and select "Act as part of the operating system" from the combo box. Click the Add button and type in "domainxxx\userxxx" in the text area, or select your username from the listbox. Click OK and you should now have the correct privileges. To start the debugging session in Visual C++ 5.0, go to the Build menu, select Start Debug, then Attach to Process. Place a check next to Show System Processes, then select inetinfo and click OK. Now load a client .htm or .asp file that will make a call into your ActiveX component. If you follow the directions in step 3 above, you should now be able to walk through your Visual Basic code.
Another Visual C++ feature is the ability to do cross-process and cross- machine debugging. If you are running in a debugger and call a .dll that has debugging info, it will automatically start another instance of the debugger and the source so that you can debug into it. Note that if the .exe is compiled optimized for size or speed, lines of dead code will be compiled out of the project. REFERENCES(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Jon Fowler, Microsoft Corporation Additional query words: MTS MTX VIPER
Keywords : kbusage kbVBp500 kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |