MFC C++/CLI mixed x64 bits application crashed when exit on mscoree.dll CorExitProcess.

  • Thread starter Thread starter Hothotgad
  • Start date Start date
H

Hothotgad

Guest
I have a mfc c++/cli mixed x64 bits application which has used WPF components.

So I try to test the code, I call the exit(0) function in CApp::ExitInstance(), then the application throw a 0xC0000005 exception.

void __cdecl __crtCorExitProcess (
int status
)
{
HMODULE hmod;
PFN_EXIT_PROCESS pfn;

if (GetModuleHandleExW(0, L"mscoree.dll", &hmod)) {
pfn = (PFN_EXIT_PROCESS)GetProcAddress(hmod, "CorExitProcess");
if (pfn != NULL) {
pfn(status);
}
}

/*
* Either mscoree.dll isn't loaded,
* or CorExitProcess isn't exported from mscoree.dll,
* or CorExitProcess returned (should never happen).
* Just call return.
*/
}

Exception thrown at 0x000000003F7983B0 in my.exe: 0xC0000005: Access violation executing location 0x000000003F7983B0.

These are many static or global managed member in my project.

I have used #pragma managed(push, off) and #pragma managed(pop) above my native codes in /clr cpp file.

The taskkill.exe also can not terminate my application either.

I've been stuck with this problem for days.


Thanks and best regards!

Continue reading...
 
Back
Top