MFC application crashes on AfxCheckDialogTemplate

1.1k views Asked by At

I have an MFC application that, if built and ran, immediately closes after opening. If I debug the application, then I get an ASSERT triggered from C:...\MFC\SRC\viewform.cpp.

ERROR: Dialog with IDD 0x008A must have the child style.

If I continue debugging the program I receive the pop-up error Failed to create empty document, and the output terminal lists the following:

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

This is a code project I have just inherited and thus am not familiar with the code. I can say that the main dialog for the application is supposed to be a split dialog showing four windows.

However I am stumped on what these errors mean. Can anyone help? Thanks in advance.

Callstack showing wrong class being called:

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
1

There are 1 answers

10
ScottMcP-MVP On
ERROR: Dialog with IDD 0x008A must have the child style.

Look in resource.h to find which dialog template ID is 0x008A. In the resource view open that dialog template for editing. Right click on the dialog and select Properties. Set the style to Child.