Issue with Rich Edit 2.0 Control

Posted on 2006-06-01
Last Modified: 2013-11-20
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????
Question by:acameron
    1 Comment
    LVL 48

    Accepted 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

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
    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.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 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

    23 Experts available now in Live!

    Get 1:1 Help Now