Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging a dll

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
0
0
IE
Hi,

I'm trying to debug my dll, but am for some reason unable to step through the code.

I managed to do this last week by having the vbp and the dll open at the same time. I ran the dll first and then the vbp. I was able to step through the code without problem, going into the dll whenever a call to it was made. Now when I try this, it runs through the code in the vbp fine, but if a call is made to the dll, it doesn't step through the dll. It just runs through the code in the background somewhere.

Can anyone tell me what else I could try to get this working?

Thanks very much for any help,
Robin
 
Dear Friend:

You should first know that you cannot trace any error in a DLL. Once it's done you cannot debbug it unless you debug the dll alone with the variables sent to the dll from the main project by initializing the variables in the Sub_Main() of the dll and make it then run as ActiveEXE project.
Once it's done you can compile it back to dll.

Hope this helps!
 
Have you, between when it was working and not working, compiled and registered the ActiveX DLL? If so, it is likely that your main program is using references to the compiled version of the dll and not the one you have open in the IDE
 
Or even just compiled the dll as vb will register it for you automatically when compiling
 
johnvai I'm not sure what you are saying.

From the post it is obvious that you are working with a COM component regestered in MTS/Component Services.

Things to do.

Make sure your COM component is regestered properly with MTS/CS.
Compile you DLL, stop the package it is running under. Delete the component and re-add it to MTS/CS.
Along with this make sure your DLL is compiling in project compatiblity mode. This will make life easier.

Next open your EXE project. Make sure the references are correct. I suggest removing the reference, Save the project, Close the project, open the project add in the reference and once agian save then agian close the project.

Next got your DLL project in a seperate VB IDE and run it. This should set up MTS/CS to use your VBP as the COM component. You may be prompted under Project Properties->Debug to "Wait for components to be created"

Next open your EXE project in another VB IDE. Goto the references. Look at your DLL's entry and you should see that it now points to the VBP file and not the dll.


VB can get VERY fussy. Also make sure your packages are running as Interactive User. If you've changed the package to a given user then debugging won't work.

If your not running your DLL under MTS/CS then you should only have to run both VBPs in one IDE under a Project Group and set your EXE as the starting application.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top