App: : InitInstance ()
{...
CMainFrame * pMainFrame=new CMainFrame;
if (! PMainFrame | |! PMainFrame - & gt; LoadFrame (IDR_MAINFRAME))
{
The delete pMainFrame;
Return FALSE;
}
}
Load main form error and set the multibyte character set
Error:
AtlThrow: hr=0 x80004005
Warning: constructing COleException, scode=E_FAIL ($80004005).
First - chance exception at 0 x7773c52f in StkUI. Exe: Microsoft c + + exception: COleException at the memory location 0 x003ae578.
Thread 0 xfc2c have withdrawn, the return value is zero (0 x0),
Warning: Uncaught exception in WindowProc (returning - 1).
Debug tracking to: __try
{
WindowResult=CreateWindowExA (dwExStyle lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
}
After the catch to the abnormal, handle memory is initialized, CreateWindowExA function with not to,,,
CodePudding user response:
His top, and points to 99!The great god, save me!
CodePudding user response:
Capture COleException abnormalities, and see what report error
Try
{
.
}
The catch (COleException * PE)
{
PE - & gt; ReportError ();
PE - & gt; The Delete ();
}
CodePudding user response:
TRY
{
# # ifndef _AFX_NO_OCC_SUPPORT
//special case for WM_DESTROY
If ((nMsg==WM_DESTROY) & amp; & (pWnd - & gt; M_pCtrlCont!=NULL))
PWnd - & gt; M_pCtrlCont - & gt; OnUIActivate (NULL);
# endif
//special case for WM_INITDIALOG
CRect rectOld;
DWORD dwStyle=0;
If (nMsg==WM_INITDIALOG)
_AfxPreInitDialog (pWnd, & amp; RectOld, & amp; DwStyle);
//the delegate to the object 's WindowProc
LResult=pWnd - & gt; WindowProc (nMsg wParam, lParam);
//more special case for WM_INITDIALOG
If (nMsg==WM_INITDIALOG)
_AfxPostInitDialog (pWnd, rectOld dwStyle);
}
CATCH_ALL (e)
{
LResult=AfxProcessWndProcException (e, & amp; PThreadState - & gt; M_lastSentMsg);
TRACE (traceAppMsg, 0, "Warning: Uncaught exception in WindowProc (ld) returning %. \ n",
LResult);
DELETE_EXCEPTION (e);
}
END_CATCH_ALL
Error:
AtlThrow: hr=0 x80004005
Warning: constructing COleException, scode=E_FAIL ($80004005).
First - chance exception at 0 x7773c52f in StkUI. Exe: Microsoft c + + exception: COleException at the memory location 0 x003ae578.
Thread 0 xfc2c have withdrawn, the return value is zero (0 x0),
Warning: Uncaught exception in WindowProc (returning - 1).
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
HWND HWND=CreateWindowEx (cs) dwExStyle, cs lpszClass,
Cs lpszName, cs. Style, cs. X, cs. J y, cs. Cx, cs, cy,
Cs hwndParent, cs hMenu, cs. The hInstance, cs. LpCreateParams);
# ifdef _DEBUG
If (hWnd==NULL)
{
TRACE (traceAppMsg, 0, "Warning: Window creation failed: GetLastError returns 0 X % 8.8 X \ n",
GetLastError ());
//print here: Warning: Window creation failed: GetLastError returns 0 x00000000
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Post the wrong print, deserve to go up the code, it's what you mean?
CodePudding user response: