I didn't wait for votes on switching to MFC versus putting the code in a dll. I used the MFC wizard to create a stub app. It compiled and ran fine with VC9. I then switched to ICC11 and recompiled. It ran fine until I exited the stub. I got this message:
The thread 'Win32 Thread' (0x1434) has exited with code 0 (0x0).
First-chance exception at 0x78a572dc (mfc90ud.dll) in RatMFC.exe: 0xC0000005: Access violation reading location 0xfffffffc.
Unhandled exception at 0x78a572dc (mfc90ud.dll) in RatMFC.exe: 0xC0000005: Access violation reading location 0xfffffffc.
Here's the stack:
mfc90ud.dll!ATL::CStringData::Release() + 0xc bytes
mfc90ud.dll!ATL::CSimpleStringT::~CSimpleStringT() + 0x1e bytes
mfc90ud.dll!ATL::CStringT > >::~CStringT > >() + 0x11 bytes
RatMFC.exe!CRatMFCView::GetMessageMap() + 0x64 bytesC++
msvcr90d.dll!___freeCrtMemory() + 0x275 bytes
msvcr90d.dll!_exit() + 0x12 bytes
>RatMFC.exe!__tmainCRTStartup() Line 599C
RatMFC.exe!wWinMainCRTStartup() Line 403C
kernel32.dll!_BaseProcessStart@4() + 0x23 bytes
This happened on exit, so the workaround is obvious, but a longer term fix would be good. I made no changes to the standard compiler switches.