HOWTO: Debug a Component Written with Visual Basic 5.0

Last reviewed: August 19, 1997
Article ID: Q172869
The information in this article applies to:
  • Microsoft Transaction Server, version 1.0
  • Microsoft Visual Basic Standard and Enterprise Editions for Windows, version 5.0
  • Microsoft Visual Studio 97

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


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.