I'm building a project along with a Dll.
The Dll must support native code so I declared it as a /clr. My project was initialy also a /clr project and everything was fine. However I'd like to include some NUnit testing so I had to switch my main project from /clr to /clr:pure.
Everything still compiles but any Dll call generates a runtime error. When I revert back to /clr everything is ok
In my Dll, exported functions are declared as follow :
#define DllExport __declspec( dllexport )
DllExport bool DisplayScan(bool bShow, bool bAllPasses) { }
I also made a .def file containing the real names of all the exported functions
LIBRARY "Controller"
EXPORTS
DisplayScan
From my main project my imports are declared as follow :
#define _DllImport [DllImport("Controller.dll", CallingConvention = CallingConvention::Cdecl)] static
_DllImport bool DisplayScan(bool bShow, bool bAllPasses)
Anyone ever encountered such a problem?