Microsoft KB Archive/200998

= How To Debug a Visual Basic DLL from Visual InterDev =

Article ID: 200998

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q200998



SUMMARY
This article demonstrates how to debug a Visual Basic ActiveX dynamic-link library (DLL) using Visual InterDev 6.0 or later.



MORE INFORMATION
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
 Start Visual Basic on the computer where Visual InterDev will be used for debugging, and create a new ActiveX DLL. Change the name of the project to MyVBComponent . Change the name of the Class module to CMyClass .  Add the following code to the DLL: Public Function DebugTest (vntNum1 as Variant, vntNum2 as Variant) as Variant DebugTest = vntNum1 + vntNum2 End Function  From the File menu, click Make MyVBComponent.dll. Set a breakpoint on the "DebugTest = vntNum1 + vntNum2" line in the DLL. From the Run menu, click Start (or press the F5 key) to run the program.</li> Start Visual InterDev, and add a new Active Server Pages (ASP) page to the project.</li>  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) %>                   </li> Place a breakpoint within the ASP page on the line that calls the DebugTest method.</li> In the Project Explorer window of Visual InterDev, right-click this ASP page, and then click Set As Start Page.</li> From the Debug menu, click Start (or press F5) to run the program.</li></ol>

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

MTXSTOP

Net Start W3SVC

To restart IIS 5.0, type the following command at a command prompt:

iisreset

<div class="references_section">