Help required to create an add-in DLL

Hello to all,
I'm trying to write an add-in .DLL for SolidWorks 2004 under Visual Basic 6.
The .DLL in itself seems to run fine... I've started my project by
modifying someone else's project (Ray Gorman). Using his .reg files which
Windows Registry Editor Version 5.00
"Description"="Perform a task..."
"Title"="Fontaine - OriginalProject"
and his batch file:
echo Engineering Studio registration command:
echo H. Fontaine Ltee - OriginalProject.dll...
regedit -s OriginalProject.reg
regsvr32 OriginalProject.dll
Using this, I'm able to register my .dll in SolidWorks and use it instead of
the OriginalProject.dll .
However, the descritpion under the Tools -- Add-in menu is still Fontaine -
OriginalProject ... Also, I don't want my add-in to replace
OriginalProject, but to be another different add-in.
What I've tried to do was to change OriginalProject.reg and
OriginalProject.dll by my names (TestProject.reg and TestProject.dll).
As I understand it, the CLSID needs to be unique. I've been able to
generate a new CLSID using code from:
formatting link
I put it in the .reg file.
However, in SolidWorks, my .dll now appears in the Add-in menu, but when I
try to activate it (in the add-in menu), SW gives an errors, says it can't
find a file...
I'm not sure about this, but I think that the problem lies in the fact that
nowhere I tell the computer that my new CLSID is linked to the
TestProject.dll file... Is this the problem? Does the CLSID need to be
hard-coded somewhere in my VB code?
Also... Should the CLSID be generated once only in my computer, and each
user will use that CLSID, or should it be generated on each user computer?
Note: I intend to distribute my add-in, so it wouldn't look good if the user
had to start the add-in using the File -- Open fucntion from SolidWorks...
I'd like to automate the registration process...
Thank you very much for your help!
As you may have guessed it, I'm quite new to this add-in and .dll stuff
(though I'm not too bad in VB, I think...)
- Fontaine_Guy
Reply to
Fontaine Guy
Loading thread data ...
formatting link
any help?
regards Markku
formatting link
Reply to
Markku Lehtola
First, you may be trying too hard. Addins are self-registering if you drag-and-drop into SW (or, open the addin file from SW using "File --> Open" and setting the file selection filter for addin .dll's).
I have some tools that may help.
This one is to purge registry settings of addin data:
Also, a work-in-progress is my add-in from VB .exe project. , filename "". This may give you some additional clues, as well as info about the registry keys you may need.
Reply to
Hello Markku,
Thank you for your tutorial... This was quite helpful, as I now may start from scratch a project...
Thanks again.
- Fontaine Guy
"Markku Lehtola" a écrit dans le message de news:chpsd1$ids$
Reply to
Fontaine Guy
You may be right, I might have been trying too hard... I still don't know exactly how to register an add-in using a batch file (which would still be nice), but it is okay to register them with "File / Open".
I will have a thorough look at your files. Thank you!
- FontaineGuy
"TheTick" a écrit dans le message de news:
Reply to
Fontaine Guy
also, if you install the SW SDK, you will get a new project type for add-ins.
Reply to
Evan T. Basalik

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.