在CXXXAPP::InitInstance()
{
::AfxInitRichEdit();
//before the Dialog Class Create
CXXXXDlg dlg
}
这样就可以了,不是在DlgClass的Init函数中。
一段实例
BOOL CRichTextTestApp::InitInstance()
{
AfxEnableControlContainer();
::AfxInitRichEdit();
// Standard initialization
CRichTextTestDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
}
else if (nResponse == IDCANCEL)
{
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}