PRB: Dialog With RichEdit May Fail During CreationLast reviewed: March 2, 1998Article ID: Q166132 |
The information in this article applies to:
SYMPTOMSDialog creation may fail if the dialog template has a Rich edit control in it. This template may be used in a dialog, CformView, or property page. The following error messages may appear in the IDE output window when you execute the program in the debugger with the debug build. No error message or warning is given if you execute the program outside the debugger or with the release build. Dialog or Property Page:
Warning: Dialog creation failed!CFormView:
Warning: Dialog creation failed! Warning: could not create view for frame. Failed to create client pane/view for frame. Warning: CDocTemplate couldn't create a frame.In the case of a CformView, the following message also appears:
Failed to create empty document. CAUSEThe Rich Edit control is not initialized.
RESOLUTIONCall the MFC global function AfxInitRichEdit before you create the dialog to initialize the Rich Edit Control. A good place to initialize the Rich Edit control is in the application's InitInstance function before you create the dialog.
STATUSThis behavior is by design.
MORE INFORMATIONWith the new dialog editor in Visual C++ 5.0, it is possible to add a Rich Edit control into a dialog template by dragging the control from the control palette. However, doing this in the dialog editor does not ensure that the required Riched32.dll library will be loaded before the Rich Edit control is created. In Win32 SDK, it is necessary to call the LoadLibrary function to load Riched32.dll before the dialog creation. In MFC, the global function AfxInitRichEdit does this for you. All you need to do is call this function before you create the dialog. Please use the online help to get more information on AfxInitRichEdit function.
Steps to Reproduce BehaviorDialog Scenario: The follow scenario reproduces the problem described above with a dialog.
The follow scenario reproduces the problem described above with a CFormView.
|
Additional query words: CreatDialogIndirect DoModal RichEdit CFormView
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |