I had an application developed in VC++ that uses a third party dll which also is developed in VC++
It works fine, and when checked with dependency walker, the application and dll depends on MFC42.dll, MSVCRT.dll, MSVCP60.dll etc.
The application is now ported to VS2008, and there is no change in the code that invoke the dll.
Normal functionalities works fine after invoking the DLL functions
But while trying to invoke function with Dialog, like
MyFunc(void)
{
handle = AfxGetResourceHandle();
AfxSetResourceHandle(::GetModuleHandle(mydll));
if( myCDialog.DoModal() == IDOK )
{
}
AfxSetResourceHandle(handle);
}
There is an error Access Violation in MFC42.dll (c0000005) while trying to execute DoModal.
The exe code is fine, as it can perfectly work with dll's made with VS2008 and higher.
Any way to resolve this error when using vc++ dll's in vs2008 exe?