Hi All,

I am trying to access Native C++ dll built in VS2010 from an C++/CLI or Managed C++ exe built in VS2008 .NET framework 3.5. I have included the header file of the Native C++ dll and included lib file for linker input, project compiled successfully. But when executing i get below exception on the line where it calls function of Native C++ dll.

"
An unhandled exception of type 'System.AccessViolationException' occurred in ExtrinsicModelWrapper.exe

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. "

Below is the code in header file i included.


Code:
__declspec(dllexport) void mockStorage_calc(DataCollector & input);
Below is the code in C++/CLI exe.

Code:
DataCollector * dc = new DataCollector(	);
mockStorage_calc(*dc);//Code where exception occurs
Please help. For my knowledge it seems the Native C++ dll built in VS2010/VS2008, will not have difference as it does not depends on dotnet framework. But i am a beginner.Please put your thoughts on this.

Thanks
Naresh