This documentation is archived and is not being maintained.

CRichEditCtrl Class

Provides the functionality of the rich edit control.

class CRichEditCtrl : public CWnd

A "rich edit control" is a window in which the user can enter and edit text. The text can be assigned character and paragraph formatting, and can include embedded OLE objects. Rich edit controls provide a programming interface for formatting text. However, an application must implement any user interface components necessary to make formatting operations available to the user.

This Windows Common control (and therefore the CRichEditCtrl class) is available only to programs running under Windows 95/98 and Windows NT versions 3.51 and later. The CRichEditCtrl class supports versions 2.0 and 3.0 of the Windows SDK rich edit control.

Caution noteCaution:

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.

For more information on using CRichEditCtrl, see:

  • Controls

  • Using CRichEditCtrl

  • Knowledge Base article Q259949 : INFO: SetCaretPos() Is Not Appropriate with CEdit or CRichEditCtrl Controls

For an example of using a rich edit control in an MFC application, see the WORDPAD sample application.

Header: afxcmn.h