Using VC6 MFC DLLs in VS2008
-
I am using an old dll which is written in VC6 MFC( Builded with mfc42u.lib), I need to reuse the same in my C++/CLI application which is in VS2008( it use mf90u.lib) while copying a string buufer to that old dll it cause an exception like "try to read/writing in protected meory"
// Class in old dll
String^ csMyString = gcnew String( "some value" );
MyClass* fromOldDll = new MyClass();
fromOldDll->m_csSomeString = static_cast(Marshal::StringToHGlobalUni(csMyString).ToPointer());
// Above line cause exceptionIs any other idea for implementing the same, it is not possible to modify the old dll Thanks Radhakrishnan G.
-
I am using an old dll which is written in VC6 MFC( Builded with mfc42u.lib), I need to reuse the same in my C++/CLI application which is in VS2008( it use mf90u.lib) while copying a string buufer to that old dll it cause an exception like "try to read/writing in protected meory"
// Class in old dll
String^ csMyString = gcnew String( "some value" );
MyClass* fromOldDll = new MyClass();
fromOldDll->m_csSomeString = static_cast(Marshal::StringToHGlobalUni(csMyString).ToPointer());
// Above line cause exceptionIs any other idea for implementing the same, it is not possible to modify the old dll Thanks Radhakrishnan G.
Unfortunately, you cannot always mix DLLs like that. One solution would be to recompile the old DLL using VC 2008.
Regards, Nish
My technology blog: voidnish.wordpress.com Code Project Forums : New Posts Monitor This application monitors for new posts in the Code Project forums.