Поделиться через


Debugging Visual Basic Components

If you are developing with Visual Basic? 6.0, you can establish an ASP file to use for testing your component. This allows you to easily move back and forth between the development and testing environments. To establish the ASP file to run when debugging your component, select Start with Full Compile from the Run menu, click "Start browser with URL", and enter the URL for the test ASP file in the provided box.

For example, if you created a Visual Basic project called "MyVBComps" that contained a class called MyClass, which exposed a method called sendResponse, you could put the following script in an .asp file to use for testing the component.

<% 
  Dim vntTest 
  Set vntTest = Server.CreateObject("MyVBComps.MyClass") 
  vntTest.sendResponse () 
%> 

If the script example was in a file called Mytest.asp, residing in a virtual directory called Mytests, on a computer called MyComputer, you could specify a URL after clicking "Start browser with URL" to test MyClass.

Note

After testing your component, remove the component instance from memory before you recompile, otherwise you will generate an error. The easiest way to make sure the component has been removed from memory is to make sure the application is being run in a separate memory space, and then click the Unload button in the Virtual Directory tab of the IIS Application's properties page.