Reg error :" Unable to Intialise Add-In component"

I got this error, when i try to run an VC++ Add-in program in Solid works 2011.  What causes this error?

Thanks in Advance.

Saran.R

SolidworksApi macros
Answers 7
RJ
RJ 2011-06-06 Best Answer

Saravanan,

This error generally occurs if one of the referenced dlls (referenced by your addin application) is not registered and OS could not find it. Please check whether all the referenced dlls are properly registered.

Hope it helps!!!

Rajat Jain

SF
SF 2011-06-09

Thanks Rajat,

I have 5 dll files generated from C# and they are registered thru a VB script file.

After build, Debug file provides 5 dll files. In that 4 dll files are already available in Solidworks folder( C:\Program Files\SolidWorks Corp\SolidWorks)

1. Solidowrks.Interop.swconst.dll

2.Solidworks.Interop.swpublished.dll

3.Solidworks.Interop.swpublished.dll

4.SolidWorksTools.dll

5th is the application dll.

As of now i am providing the dll location path in VBscript folder.

Is there any procedure to check dll files are registered?

( Earlier version of the add in was made in VC 6.0 and works fine with Solidworks2007, this one is for Solidworks2011)

Thanks.

RJ
RJ 2011-06-09

Saravanan,

I think it is important to know more before suggesting you with a solution.

  1. Do you observer the error on your development machine?
  2. What OS do you see this behavior with? Is it x86 or x64? Does it occur in any one or both of these OS types?

It might be that your VBScript works fine on x86 machine. There are many discussions related with regstering dlls in x64 machine so that should just solve your issue.

If it occus with x86 then we need to check your VBScript. If you can attach your script file then someone can quickly check and fix it.

Hope it helps!!!

Rajat Jain

SF
SF 2011-06-14

Just found the issue. It was with regasm.exe

Thanks Rajat.

SF
SF 2011-06-27

Dear Saravanan;

could you please elaborate a bit on your solution? I have the same issue, with a project that I originally created in VB2005 (standard version, not Express).

I re-worked the program in VB2010 (Express edition, waiting for the upgrade to arrive), and the add-in works great in my machine, when I compile it with SW not running. However, if I compile it WITH SW running, and then i try to load the dll later, I get the same warning (unable to initialize add-in). I guess that during the first method, VB takes care of the registry the required entries, and that during the other method, these are not added.

I am working on a W7-64bit machine, with SW 2011

Regards,

Thymen

SF
SF 2011-06-27

Thymen,

I am working with C# for my addin application. Please try this.

                          1. dll/exe should be in a location where Solidworks.exe located( generally C:\Program Files\SolidWorks Corp\SolidWorks)

                          2.  dll file need to be registered using regasm.exe ( for Win 7 file ) in command prompt :

                               C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727>regasm.exe  /tlb "C:\Program Files\SolidWorks Corp\SolidWorks\test.dll"

                     

                         here "C:\Program Files\SolidWorks Corp\SolidWorks\test.dll" refers the path of the file that need to be registered.

                       

Hope this helps!

Regards,
Saravanan.R

SF
SF 2011-06-27

That is the trick!

It is required that the dll be in the Solidworks folder. I tried with the dll in another folder (my preference), but that did not work.

Saravanan, thanks a lot!

Thymen