Solved

Rich Edit control in dialog box

Posted on 1998-08-24
3
256 Views
Last Modified: 2013-11-19
Environment: VC++ 5.0, Win NT 4.0

I have a problem with my application.  I initially created it with CEdit controls in a modal dialog box, but now I want to convert the CEdit controls to rich edit controls instead.  However, when I add a "Rich Edit" with the dialog editor, my application doesn't start anymore without providing any error message.  It fails to create the initial dialog box, even if I don't change any of the CEdit's and only add one small "Rich Edit".  What am I doing wrong?
0
Comment
Question by:Claus
  • 2
3 Comments
 
LVL 23

Expert Comment

by:chensu
Comment Utility
If you are using a rich edit control in a dialog box (regardless whether your application is SDI, MDI, or dialog-based), you must call AfxInitRichEdit once before the dialog box is displayed. A typical place to call this function is in your program’s InitInstance member function. You do not need to call it for each time you display the dialog box, only the first time. You do not have to call AfxInitRichEdit if you are working with CRichEditView.
0
 

Author Comment

by:Claus
Comment Utility
I tried to put AfxInitRichEdit in OnInitDialog of the main dialog box both before and after its call to ::OnInitDialog, but it didn't help.  My application still doesn't start and gives no explanation or errorcode.

/Claus

0
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
Comment Utility
Put it in the InitInstance of your CWinApp class.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now