int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine, int nCmdShow)
{
ASSERT(hPrevInstance == NULL);
int nReturnCode = -1;
CWinThread* pThread = AfxGetThread();
CWinApp* pApp = AfxGetApp();
// AFX internal initialization
if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
goto InitFailure;
// App global initializations (rare)
if (pApp != NULL && !pApp->InitApplication()) <<<<<<<--------運行至該處,導致goto InitFailure
goto InitFailure;
// Perform specific initializations
if (!pThread->InitInstance())
{
if (pThread->m_pMainWnd != NULL)
{
TRACE(traceAppMsg, 0, "Warning: Destroying non-NULL m_pMainWnd\n");
pThread->m_pMainWnd->DestroyWindow();
}
nReturnCode = pThread->ExitInstance();
goto InitFailure;
}
nReturnCode = pThread->Run();
InitFailure:
#ifdef _DEBUG
// Check for missing AfxLockTempMap calls
if (AfxGetModuleThreadState()->m_nTempMapLock != 0)
{
TRACE(traceAppMsg, 0, "Warning: Temp map lock count non-zero (%ld).\n",
AfxGetModuleThreadState()->m_nTempMapLock);
}
AfxLockTempMaps();
AfxUnlockTempMaps(-1);
#endif
AfxWinTerm();
return nReturnCode;
}
如上文代碼中表述,在MFC 系統函式中,觸發了goto InitFailure,導致軟體閃退。
求有經驗大佬提供解決思路。
uj5u.com熱心網友回復:
彈出來的例外提示內容:unhandled exception in .exe :0xC0000005:Access Violation.
uj5u.com熱心網友回復:
IDE 選單 除錯中 例外 打開 Win32的 C0000005 例外,除錯運行, 奔潰時會停到代碼處, 結合呼叫堆疊 逐漸回退到你代碼處修改解決之
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/58495.html
標籤:基礎類
