May 13th, 2003, 03:09 PM
Debug VB ActiveX DLL - How?
first let me say that I've read the other threads on this topic and I'm still not clear what to do ... maybe I'm a little slow?
I've created a VB ActiveX DLL that is called by an external application - lets use Excel as an example. I've compiled my app and it runs, so it is already registered on my machine. I've got a bug somewhere in my app because the output is not correct. So my question is - how can I debug my DLL when it is called by this external app I.e. I want to single-step through my code to find the error(s)? I assume it has something to do with the Debugging Tab under the Project Properties ... but the VB Help on ths topic is is lame.
Any help would be appreciated.
May 13th, 2003, 03:49 PM
What you need to do first is turn on Binary Compatibility.
In the Project Properties select the Component tab. Set the Binary Compatibility option and then specify the location of your compiled dll. Note its best if you use a copy of the dll and have it in a seperate folder from where it is typically installed.
Place a break point at the spot you want to start debugging.
Start your dll in the VB IDE.
Run the application that uses your dll.
VB will then stop execution at the break point you specified.
Normally, once you set binary compatibilty you would never ever turn it off unless absolutely neccessary.
Jun 5th, 2003, 11:00 AM
I have had mixed results when trying to hit break points in dlls in the ide like that...although I am not sure I was on binary compat
another way to do it is to use a project group
(file add project)
then add a standard exe project to your group with the dll
project set the exe as the startup project add a reference to the
dll in the project properties then you can test all your methods
and by using them from within the exe and setting breakpoints in either project and step between them.
the quickest method of developing a dll though I think is to write all teh code as classes in a standard project and debug the heck out of them and only move them to a dll when they are known stable
I usally wait a matter of months before I feel safe enough to export them to a dll just to make sure they are functioning properly and that I am happy with the interface and how it fits into the rest of my code and that no more additions are needed.
Free Code, papers, tools, and more
Apr 13th, 2004, 03:28 PM
I have found a simpler way to debug a DLL.
Open the DLL project.
Go to Project, then Properties.
Go to the Debugging Tab, and enter an executable file which uses your DLL in the field called "Start Program".
Then hit Run, and it will launch the .exe and stop at any breakpoint in the DLL.
Click Here to Expand Forum to Full Width
Survey posted by VBForums.