How to use Visual Studio 2010 for C++ to develop SolidWorks add-ins?

Hi,

Now I'm using SolidWorks 2010 and Microsoft Visual Studio 2005 version. I usually use C++ COM to develop a SolidWorks add-in because it is easy for me to combine some external c++ libraries with SolidWorks API.

In SolidWorks API help file, I found that SolidWorks 2010 API SDK officially supprots Visual Studio 2005 and 2008 versions.

My question is, is there a way to use Visual Studio 2010 to develop a SolidWorks add-in using C++ COM?

I found a discussion that there may be a way to use Visual Studio 2010 in case of C#.

Thanks for reading this question.

Best regards,

Moonki

SolidworksApi macros
Answers 3
AS
AS 2010-10-07 Best Answer
RX
RX 2011-04-18

I can't open this webpage,could you please post a new one for resolve this problem?

AS
AS 2011-04-18

The link still works however this is the body of the document.

The SolidWorks Enterprise PDM API does not currently support .NET Framework 4.0 and displays the following message when loading an add-in targeted for .NET Framework 4.0:

“The Archive Server could not open the Windows Registry.”

To solve this problem, change your project’s target framework to .NET Framework 3.5 or earlier. However, after changing your project’s target framework to .NET Framework 3.5 or earlier, you might not be able to reference EdmInterface.dll because Visual Studio creates primary interop assemblies using the latest version of the .NET Framework. You can generate your own interop by using tlbimp.exe from an earlier version of .NET Framework. For example:

tlbimp EdmInterface.dll/sysarray/out:Interop.EdmLib.dll/namespace:EdmLib

Using .NET Framework 4.0 embedded interop types cause SolidWorks Enterprise PDM API calls involving arrays to fail. To solve this problem, disable type embedding from the referenced assembly Interop.EdmLib’s properties by setting Embed Interop Types to False in Visual Studio 2010: