HOWTO: Debug a Component Written with Visual Basic 5.0

ID: Q172869

The information in this article applies to:

SUMMARY

You can use Microsoft Developer Studio 97 to debug a Microsoft Transaction Server (MTS) component written in Visual Basic 5.0. This article describes the steps necessary to do this.

MORE INFORMATION

To use Microsoft Developer Studio 97 to debug an MTS component written in Visual Basic 5.0, perform the following steps:

1. In a Visual Basic ActiveX DLL project, create your components.

2. On the Project menu, click Properties. Click the Compile tab and make

   sure that the "Compile to Native Code," "No Optimization," and "Create
   Symbolic Debug Info" options are all selected. Click OK.

3. Compile the DLL.

4. Add the DLL to an MTS package.

5. Start Developer Studio. On the File menu, click Open Workspace. By

   default, the Open Workspace dialog box only displays files with a .dsw
   or .mdp file exension, so you must change the filter so that files
   ending in .dll are displayed. Select your Visual Basic DLL and then
   click Open.

6. On the Project menu, click Settings, and then click the Debug tab. In
   the Executable For Debug field, type the path to Mtx.exe (for example,
   c:\mtx\mtx.exe). In the Program Arguments field, type /p:{package_ID}.
   (You can find the package ID by using the MTS Explorer to open your
   package's Properties dialog box and then switching to the General tab.)
   After you have set both fields of the Debug dialog box, click OK.

7. On the File menu, click Open, and then select the .cls file that is
   associated with your DLL. Set break points on the lines you want to
   break on.

8. Using Transaction Server Explorer, select the My Computer icon. On the
   Tools menu, click Shutdown Server Processes.

9. In Developer Studio, press F5 to start the debug session. Call your MTS
   component from a base client. When the call is made, Developer Studio
   will halt execution wherever you have set a breakpoint. You can now step
   forward through the code using F10 or F11, and resume normal execution
   by pressing F5.
Keywords          : kbinterop kbusage TSrvGen 
Version           : WINDOWS:5.0; WINDOWS NT:1.0,97
Platform          : winnt
Issue type        : kbhowto

Last Reviewed: August 20, 1997