Click to See Complete Forum and Search --> : Trouble with RichEdit


April 9th, 1999, 10:13 AM
Hello world,

I have a "dialog based" MFC application that was originally created with Visual C++ 4.0 and has gone through 5.0 to 6.0 SP-2.
Each time I try to include a rich edit control in my main dialog (just dragged in with the dialog editor, no additional programming), the programm will compile fine but cause a "debug assertion failed" when it is started.
If I include a rich dit control in any other dialog (e. g. the "about" dialog), this dialog will not be displayed when called at runtime. Anything works fine again when I remove the rich edit control.

I have absolutely no idea why this happens. Is there any known problem with the rich edit control? Or am I doing something wrong?

Who can help?

Jens
lenge@hft.e-technik.uni-dortmund.de

April 10th, 1999, 08:16 PM
Dialog resources uses a DIALOG structure. When you put a RichEdit control into dialog using the Resource Editor it causes the dialog resource to the the DIALOGEX structure. The CDialog class currently does not support the DIALOGEX structure and this causes the dialog not to by displayed when certain controls are used. To fix the problem, create the RichEdit controls in your dialog's OnInitDialog function.

Todd Jeffreys
April 11th, 1999, 10:17 AM
The real answer is this. Call AfxInitRichEdit() in your CWinApp::InitInstance