Solved

Rich Edit control in dialog box

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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

623 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