超级难题啊,我的MDI程序打开第一个文档正常,如果打开第二个文档就显示“创建空文档失败!"超郁闷~~~~~~~~ [所有相关帖子]
经过层层跟踪,发现是这句代码有问题: HWND hWnd = (HWND)::SendMessage(pParentWnd->m_hWndMDIClient,
WM_MDICREATE, 0, (LPARAM)&mcs);
if (!AfxUnhookWindowCreate())
PostNcDestroy(); // cleanup if MDICREATE fails too soon if (hWnd == NULL)
return FALSE; //!!!!程序在这里return FALSE!!!!如果关掉所有文档,再打开第一个正常,但是打开第2个又弹出同样错误!!!
超郁闷~~~~~~~~~~~~~TRACE里面出现了这些信息:
Warning: Window creation failed: GetLastError returns 0x00000000
Warning: could not create view for frame.
Failed to create client pane/view for frame.
Warning: CDocTemplate couldn't create a frame.
经过层层跟踪,发现是这句代码有问题: HWND hWnd = (HWND)::SendMessage(pParentWnd->m_hWndMDIClient,
WM_MDICREATE, 0, (LPARAM)&mcs);
if (!AfxUnhookWindowCreate())
PostNcDestroy(); // cleanup if MDICREATE fails too soon if (hWnd == NULL)
return FALSE; //!!!!程序在这里return FALSE!!!!如果关掉所有文档,再打开第一个正常,但是打开第2个又弹出同样错误!!!
超郁闷~~~~~~~~~~~~~TRACE里面出现了这些信息:
Warning: Window creation failed: GetLastError returns 0x00000000
Warning: could not create view for frame.
Failed to create client pane/view for frame.
Warning: CDocTemplate couldn't create a frame.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货