Solved

Rich Edit control in dialog box

Posted on 1998-08-24
3
258 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 49
how do i create updater to My Activex application? 3 88
canBalance challenge 34 86
changeXy challenge 13 83
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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