Creates the Windows rich edit control and associates it with this CRichEditCtrl object.
Specifies the edit control's style. Apply a combination of the window styles listed in the Remarks section below, and edit control styles, described in the Platform SDK.
Specifies the edit control's parent window (often a CDialog). It must not be NULL.
Specifies the edit control's ID.
You construct a CRichEditCtrl object in two steps. First, call the CRichEditCtrl constructor, then call Create, which creates the Windows edit control and attaches it to the CRichEditCtrl object.
When you create a rich edit control with this function, first you must load the necessary common controls library. To load the libary, call the global function AfxInitRichEdit, which in turn initializes the common controls library. You need to call AfxInitRichEdit only once in your process.
These messages are handled by default by the OnNcCreate, OnNcCalcSize, OnCreate, and OnGetMinMaxInfo member functions in the CWnd base class. To extend the default message handling, derive a class from CRichEditCtrl, add a message map to the new class, and override the above message-handler member functions. Override OnCreate, for example, to perform needed initialization for the new class.
Apply the following window styles to an edit control.
WS_GROUP To group controls.
WS_TABSTOP To include edit control in the tabbing order.
For more information about window styles, see CreateWindow in the Platform SDK.
// pParentWnd is an external pointer to the parent window. extern CWnd* pParentWnd; // The pointer to my rich edit control. extern CRichEditCtrl* pmyRichEditCtrl; pmyRichEditCtrl->Create( WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE, CRect(10,10,100,200), pParentWnd, 1);