Load .DLL addin fails

Discussion in 'SolidWorks' started by Louis-Philippe Salin de l'Etoile, Jan 22, 2004.

  1. I'm presently building a .DLL add-in for Solidworks using VB6. In my
    project, I use an office web component in a new modelview tab (pretty much
    like in the api fundamentals book) and an OCX control featuring a listview
    with selectable components that is nested in the feature manager.

    Running the program as an EXE is great, the listview control is added and
    populated and the web component is created. I just can't respond to events
    (which is normal, I think). But when I compile it into an activeX dll and
    add it to solidworks, solidworks tells me that it couldn't load it because
    either the dll or one of it's component is missing.

    Any idea why it runs fine when pressing F5 in VB and not when compiled as a
    dll?

    Thanks!

    Louis-Philippe
     
    Louis-Philippe Salin de l'Etoile, Jan 22, 2004
    #1
  2. Louis-Philippe Salin de l'Etoile

    Heikki Leivo Guest

    Running the program as an EXE is great, the listview control is added and
    Uhm, just a guess - have you implemented the required SWAddin interface in
    your ActiveX dll project? If you have, can't you just debug the DLL and see
    what goes wrong?


    -h-
     
    Heikki Leivo, Jan 22, 2004
    #2
  3. Yeah, I have. I should've mentionned that the .DLL used to work before the
    inclusion of my ocx control into it.
    The problem is simply that solidworks won't load the DLL. So I can't debug
    it at all.

    Louis-Philippe
     
    Louis-Philippe Salin de l'Etoile, Jan 22, 2004
    #3
  4. Louis-Philippe Salin de l'Etoile

    TheTick Guest

    What makes a .dll into a SW Addin?

    An addin .dll must have a CLASS module that implements the SW addin
    type library (swpublished.tlb) along with the usual sldworks.tlb. The
    Instancing property of the class module must be set to "5-MultiUse".
    The class module requires at least two procedures
    "SwAddin_ConnectToSW" and "SwAddin_DisconnectFromSW".

    SW doesn't see the .dll when it registers. It sees the class module,
    makes an instance of it, and uses it to access the rest of the .dll.
    This is what you see in the registry under
    HKLM/Software/Solidworks/Addins.

    Post back if you would like me to send a sample file.

    Regards,
    Roland Schwarz
     
    TheTick, Jan 22, 2004
    #4
  5. Have you tried looking at your addin DLL dependencies with the Visual Studio
    Tool "Depends"? Depends can often show you whether a component that the DLL
    relies on is missing.
     
    Paul Delhanty, Jan 24, 2004
    #5
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.