我有一个MFC应用程序,如果构建并运行,打开后会立即关闭。如果我调试应用程序,那么我从C:... \ MFC \ SRC \ viewform.cpp触发ASSERT。
ERROR: Dialog with IDD 0x008A must have the child style.
如果我继续调试程序,我会收到弹出错误Failed to create empty document
,输出终端会列出以下内容:
Warning: couldn't create client pane for splitter.
Failed to create client pane/view for frame.
Warning: Window creation failed: GetLastError returns 0x00000000
Warning: failed to create CFrameWnd.
Warning: CDocTemplate couldn't create a frame.
The thread 0xFD8 has exited with code 0 (0x0).
这是我刚刚继承的代码项目,因此不熟悉代码。我可以说应用程序的主对话框应该是一个显示四个窗口的拆分对话框。
但是我对这些错误的含义感到难过。有人可以帮忙吗?提前谢谢。
Callstack显示错误的类被调用:
CFormView::Create(const char * 0x00000000, const char * 0x00000000, unsigned long 1342177280, const tagRECT & {top=0 bottom=10 left=0 right=10}, CWnd * 0x003d5198 {CSplitterWnd hWnd=0x0006058e}, unsigned int 59648, CCreateContext * 0x0012fa7c) line 69 + 25 bytes
CSplitterWnd::CreateView(int 0, int 0, CRuntimeClass * 0x0049d020 struct CRuntimeClass const CAgentsView::classCAgentsView, tagSIZE {...}, CCreateContext * 0x0012fa7c) line 311 + 48 bytes
答案 0 :(得分:1)
ERROR: Dialog with IDD 0x008A must have the child style.
在resource.h中查找哪个对话框模板ID为0x008A。在资源视图中打开该对话框模板进行编辑。右键单击对话框,然后选择“属性”。将样式设置为Child。