Link to home
Start Free TrialLog in
Avatar of european
european

asked on

dialog creation fails for rich edit control

I have a dialog that contains a CEdit control. The creation
(call of DoModal () of the dialog related class) works fine.
If I replace the edit control by a rich text edit control I get the
warning "Dialog creation failed!".

Why? Do I have to make something special for dialogs that
contain rich text edit  controls?

I am using VC++ 5.0.
ASKER CERTIFIED SOLUTION
Avatar of AVaulin
AVaulin
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think that is'n the problem. I tried using CRichEditCtrl, and that has nothing to do with CRichEditView, and I resolved the problems described above. Also SubClassDlgItem() didn't work.
OK! Can you show more code? Best way is sending sources to me (I'm at av@protec.kiev.ua). I sure that I can help you.
Avatar of european
european

ASKER

The problem is very easy to reproduce:

Start VC5++. Create a new project with
New/Project.
Select "MFC AppWizard (exe)",
and create a Dialog based application.

Compile and run the application - everything
is fine.

Add a RichEdit control to the Dialog using
the resource editor. Recompile and run
the program. The program will instantly
exit, with a warning that the dialog could
not be created (in debug mode).
OK! I really use VC 4.1 (it haven't posibility to add rich control to dialog). I've tried to do what you did with VC 5.0 and saw situation like you. The only way I see to solve your problem is deleting rich control from dialog resource and adding it in OnInitDialog method with help Create method.
Try and if you'll see no success you must reject my answer to give posibility to answer another experts.
Good luck.