MFC 应用程序在 AfxCheckDialogTemplate 上崩溃

MFC application crashes on AfxCheckDialogTemplate

本文关键字:崩溃 AfxCheckDialogTemplate 应用程序 MFC      更新时间:2023-10-16

我有一个MFC应用程序,如果构建并运行,打开后会立即关闭。如果我调试应用程序,那么我会从 C:...\MFC\SRC\viewform.cpp 触发一个断言。

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).

这是我刚刚继承的代码项目,因此不熟悉代码。我可以说应用程序的主对话框应该是显示四个窗口的拆分对话框。

但是,我对这些错误的含义感到困惑。谁能帮忙?提前谢谢。

调用

堆栈显示正在调用的错误类:

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
ERROR: Dialog with IDD 0x008A must have the child style.

在 resource.h 中查找0x008A的对话框模板 ID。在资源视图中,打开该对话框模板进行编辑。右键单击对话框并选择属性。将样式设置为"子级"。