由于AfxInitRichEdit() 装载的是 RichEdit 1.0 Control (RICHED32.DLL),该版本BUG较多,需要在装载3.0的控件。方法如下:
以对话框为例:
(1) 增加一全局变量 HMODULE hMod;
(2) 在CxxxApp::InitInstance()中添加一句hMod = LoadLibrary(_T("riched32.dll"));
在CxxxApp::ExitInstance()中添加一句FreeLibrary(hMod);
(3) 在对话框上放一个richedit,文本方式打开.rc文件修改该richedit控件的类名"RICHEDIT" to "RichEdit20a".
如果对话框不出现,则在添加 AfxInitRichEdit 方法。
VC.NET以后版本:(msdn上的做法,适用于用VC.NET及以后版本创建的工程)
To update rich edit controls in existing Visual C++ applications to version 2.0,
open the .RC file as text, change the c