CRichEditCtrl in CDialog - basics

This is a very basic question: How do I put a CRichEditCtrl window in a dialog ?

I created a test CDialog-based application with dialog MyDialog, and it worked. But as soon as I dragged a CRichEditCtrl resource to add rich edit window to my dialog template, the application quit working, failing on MyDialog.DoModal(). I used class wizard to add CRichEditCtrl member m_RichEdit to MyDialog, and call m_RichEdit.Create(), but with no result.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

olegspAuthor Commented:
Edited text of question.
I believe you have to call AfxInitRichEdit() before you can use the control...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
olegspAuthor Commented:
You are right !

Can you explain what AfxInitRichEdit() actually does?  Why MSDN documentation on this function says "If you use rich edit via CRichEditCtrl, you don't need to call this function." - this is exactly what I am doing, but I have to call AfxInitRichEdit() !
Here's the (scanty) documentation on this:

BOOL AFXAPI AfxInitRichEdit( );


Call this function to initialize the rich edit control for the application. It will also initialize the common controls library, if the library hasn’t already been initialized for the process. If you use the rich edit control directly from your MFC application, you should call this function to assure that MFC has properly initialized the rich edit control runtime. If you use rich edit via CRichEditCtrl, CRichEditView, or CRichEditDoc, you don't need to call this function.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.