This is driving me up the wall so I hope someone can help :-D
I have an existing Native C++ DLL created in visual studio 2008.
I want to use some of the class's and the functionality that they provide from within a C++/CLI project (wrapper DLL) which in turn can be used from other .NET applications so in affect I will have a .NET application which references a C++/CLI dll which in turn references a native C++ dll
I can create each of the components as separate protects within a single VS2008 solution file and everything builds without error.
The .NET application runs without error and is able to instantiate the C++/CLI object that I have without error. The problem occurs when I call a method on the C++/CLI object which in turn instantiates a native class. I can debug the code right to the point where:
NativeObject no = new NativeObject();
is called at which point I get a '
System.Runtime.InteropServices.SEHException' occurred in .dll' :confused::confused:
The native code works fine used within other native projects the problems only occur in this .NET environment.
For reference I'm exporting class definitions from the native DLL using this at the top of the .h file
#ifdef EXPORT_IMS_CORE_CLASS
#define IMS_CORE_CLASS_API __declspec( dllexport )
#else
#define IMS_CORE_CLASS_API __declspec( dllimport )
#pragma message( "Automatic link to IMSCore.lib (IMS::DataTypes::DataObject)" )
#pragma comment( lib, "IMSCore.lib" )
#endif
I can supply a very cut down version of the solution where the error occurs if anyone can have a look
Thanks in advance for any help, Simon