Load .DLL addin fails

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
Reply to
Louis-Philippe Salin de l'Etoile
Loading thread data ...
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?
Reply to
Heikki Leivo
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.
Reply to
Louis-Philippe Salin de l'Etoile
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
Reply to
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.
Reply to
Paul Delhanty

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.