真是奇怪?
放入任何东西都没问题,就是放入RICHEDIT之后,编译也通过,但就是编译出来的程序不能运行,任何错误提示都没有,窗口都不显示?
请教各位高人,这是怎么回事?
Project是MFC.
在你的程序中加入AfxInitRichEdit();比如在XXXApp::InitInstance()中就可以。
csdn上有关于CRichEdit的初始化
Important 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.
类似的还有ActiveX控件
也要初始化
这个问题我前两天也问过,我总结出是这样一个道理:
1、说明该组件来源于windows的动态链接库comctrl32.dll,属于该动态库中的扩展功能;
2、调用初始化函数主要是为了初始化所要使用的组件。起到一个注册组
件的作用;
3、来自于该库中的所组件均需要经过初始化的操作;