Solved

Rich Edit control in dialog box

Posted on 1998-08-24
3
257 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
ID: 1321198
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
ID: 1321199
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
ID: 1321200
Put it in the InitInstance of your CWinApp class.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bigDiff challenge 17 84
sum28 challenge 31 106
fizzArray  challenge 1 63
matchUp  challenge 9 94
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

895 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