MFC app Assert fail at CRecentFileList::Add on Command line FileOpen
问题 I'm using VS2010 and Windows 7, and my app is SDI shared DLL, upgraded from VC6. After installing my application, if the user double-clicks the registered file type, the application crashes at the MFC function: void CRecentFileList::Add(LPCTSTR lpszPathName, LPCTSTR lpszAppID) { // ... #if (WINVER >= 0x0601) // ... #ifdef UNICODE // ... #endif ENSURE(SUCCEEDED(hr)); // Crash here: "hr = 0x800401f0 CoInitialize has not been called." This is called from the InitInstance() function: // Parse