Results 1 to 4 of 4

Thread: Debug VB ActiveX DLL - How?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Posts
    20

    Debug VB ActiveX DLL - How?

    Hello,

    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.

    Thanks,

    Dave

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    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.

    HTH

  3. #3
    Addicted Member
    Join Date
    Feb 2003
    Posts
    237
    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

    http://sandsprite.com

  4. #4
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    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.

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width