需要加入一行来初始化RichEdit,加入::AfxInitRichEdit();
BOOL CEx06aApp::InitInstance()
{
AfxEnableControlContainer();
::AfxInitRichEdit();