Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dialog creation fails for rich edit control

Posted on 1997-06-18
5
Medium Priority
?
565 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:european
  • 3
5 Comments
 
LVL 4

Accepted Solution

by:
AVaulin earned 50 total points
ID: 1302180
It sounds like you want to attach Edit control to CRichEditView object. But you can't do this. If you want to use rich edit control you must add it in OnInitDialog method with help Create method. Be sure that CRichEditView object is dialog class member.
Good luck.
0
 
LVL 1

Expert Comment

by:MarkusLoibl
ID: 1302181
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.
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1302182
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.
0
 

Author Comment

by:european
ID: 1302183
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).
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1302184
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.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Integration Management Part 2
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question