How To Debug a Visual Basic DLL from Visual InterDev

This article was previously published under Q200998
This article has been archived. It is offered "as is" and will no longer be updated.
This article demonstrates how to debug a Visual Basic ActiveX dynamic-link library (DLL) using Visual InterDev 6.0 or later.
The Component Object Model (COM) DLL needs to be registered on the computer that is creating the object (through Server.CreateObject).

Step-by-Step Example

  1. Start Visual Basic on the computer where Visual InterDev will be used for debugging, and create a new ActiveX DLL.
  2. Change the name of the project to MyVBComponent.
  3. Change the name of the Class module to CMyClass.
  4. Add the following code to the DLL:
    Public Function DebugTest (vntNum1 as Variant, vntNum2 as Variant) as Variant       DebugTest = vntNum1 + vntNum2   End Function					
  5. From the File menu, click Make MyVBComponent.dll.
  6. Set a breakpoint on the "DebugTest = vntNum1 + vntNum2" line in the DLL.
  7. From the Run menu, click Start (or press the F5 key) to run the program.
  8. Start Visual InterDev, and add a new Active Server Pages (ASP) page to the project.
  9. Add the following code to the new ASP page:
       <%      Dim objMyComponent, vntNum1, vntNum2, vntResult      vntNum1 = 1      vntNum2 = 2      Set objMyComponent = Server.CreateObject("MyVBComponent.CMyClass")      vntResult = objMyComponent.DebugTest(vntNum1, vntNum2)      Response.Write(vntResult)   %>					
  10. Place a breakpoint within the ASP page on the line that calls the DebugTest method.
  11. In the Project Explorer window of Visual InterDev, right-click this ASP page, and then click Set As Start Page.
  12. From the Debug menu, click Start (or press F5) to run the program.
NOTE: If your project is not already configured within Microsoft Internet Information Server (IIS) for debugging, Visual InterDev prompts you to set this up. Click Yes in all of the dialog boxes that Visual InterDev presents, and Visual InterDev configures this automatically. Also note that the function keys that are used for debugging are different in Visual InterDev and Visual Basic.

If the DLL is already loaded, you must restart IIS before you can debug the DLL, or you cannot stop on breakpoints. To restart IIS 4.0, type the following commands at a command prompt:
Net Stop IISAdmin /y
Net Start W3SVC
To restart IIS 5.0, type the following command at a command prompt:
For additional information%1, click the article numbers below to view the articles in the Microsoft Knowledge Base:
198432 PRB: Server Object Error 'ASP 0178' Instantiating COM Object
259725 PRB: Error When You Debug COM+ in the VB IDE with ASP Client
244272 INFO: Visual InterDev 6.0 Debugging Resources

Article ID: 200998 - Last Review: 02/23/2014 01:12:41 - Revision: 2.2

  • Microsoft Visual InterDev 6.0 Standard Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • kbnosurvey kbarchive kbbug kbdebug kbhowto KB200998