How to debug Solidworks add-in with ATL COM dll interface

Discussion in 'SolidWorks' started by humorstar, Oct 30, 2005.

  1. humorstar

    humorstar Guest

    Hello,

    I am using Solidworks 2005 API to write Add-in for Solidworks. I am
    using Visual C++. NET 2003 to write ATL Com-based add-in. Could anyone
    please tell me how to debug the add-in efficiently? So far I have no
    good way to debug. I could not find any useful information from the API
    help files.

    Any suggestions will be highly appreciated. Thank you!
     
    humorstar, Oct 30, 2005
    #1
  2. for VB6 (no idea if this works in C++, but maybe you can figure
    something similar out):
    1. add breakpoint to the code (F9), for example for the last line of
    SwAddin_ConnectToSW function
    2. press F8
    3. start SW
    4. press F8 until you are at the end of the function
    5. do what ever you need within SW, switch to VB and use F8 to run code
    line by line

    this way gives you the normal error messages and you don't have to
    compile dll again and again just for testing..

    --

    regards

    Markku Lehtola

    www.markkulehtola.net
     
    Markku Lehtola, Oct 30, 2005
    #2
  3. humorstar

    humorstar Guest

    Hi Markku,

    Thanks a lot. I just figure out how to do in VC++, similar to what you
    decribed in VB.
    In VC, we can just start in debug mode, then VC will ask for the host
    program, browse to select solidworks; then we can load addin in
    solidworks; and the debug information is in VC IDE.

    In VS.NET there is a VC++ utility called 'MFC-ATL Trace Tool', which I
    guess would be useful but I don't know how to make it useful.

    Thank you!
     
    humorstar, Oct 30, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.