Solved

Rich Edit control in dialog box

Posted on 1998-08-24
3
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand LInux Boot partition remotly 3 102
substring method in java 1 136
while loop over for loop 7 116
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 116
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: 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…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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