[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

Issue with Rich Edit 2.0 Control

I am having an issue with adding a rich edit 2.0 control to a dialog MFC application.  I have an existing application and I added a dialog to display a log.  If I use a multi line edit box it shows in it but the line breaks dont work.  I wanted to use a rich edit 2.0 control but every time I add it it compiles fine but when I click view log it crashes with debug assertion failed.  So I tried creating a new test app with the MFC wizard and adding a rich edit 2.0 control to the main dialog and it to crashes.  So I installed .net 2002 versus .net 2003 and STILL same issue.  So I built a second windows computer and installed .vs .net 2002 and I tried again to create a new clean app and add a rich edit 2.0 control and it just crashes.  If I take the rich edit 2.0 control out it load the dialog with no issue.  Any no what I am doing wrong here????
1 Solution
From MSDN topic "CRichEditCtrl Class":
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.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now