RichEdit导致Dialog初始化失败
来源:互联网 发布:淘宝网店如何找上家 编辑:程序博客网 时间:2024/05/01 20:43
想做一个Tab窗口,结果报错,DEBUG发现是子窗口Create时出错,添加空窗口时没有错误,于是猜想可能是子窗口上的控件引起的错误,便新建一个测试工程,逐个窗口逐个控件地添加然后运行。果然在添加到Rich Edit的时候又出现了那个错误,上网一查,发现:
窗口中有RichEdit控件时需要在初始化函数中添加AfxInitRichEdit()
查了一下MSDN对AfxInitRichEdit()的解释如下:
This function is provided for backward compatibility. Applications created with Visual C++ .NET and later useAfxInitRichEdit2.
AfxInitRichEdit loads RICHED32.DLL to initialize version 1.0 of the rich edit control. To use version 2.0 and 3.0 of the rich edit control, RICHED20.DLL needs to be loaded. This is accomplished with a call toAfxInitRichEdit2. If you have dialog resources with the rich edit control created prior to Visual C++ .NET, the rich edit controls are automatically version 1.0. Rich edit controls inserted using the Visual C++ .NET Resource Editor are version 2.0.
To update rich edit controls in existing Visual C++ applications to version 2.0, open the .RC file as text, change the class name of each rich edit control from "RICHEDIT" to "RichEdit20a". Then replace the call toAfxInitRichEdit with AfxInitRichEdit2.
This function also initializes the common controls library, if the library hasn't already been initialized for the process. If you use the rich edit control directly from your MFC application, you should call this function to assure that MFC has properly initialized the rich edit control runtime. If you call the Create method of CRichEditCtrl, CRichEditView, or CRichEditDoc, you typically don't need to call this function, but in some cases it might be necessary.
Call this function to initialize the richeditcontrol for the application. It will also initialize the common controls library, if the library hasn’t already been initialized for the process. If you use thericheditcontrol directly from your MFC application, you should call this function to assure that MFC has properly initialized thericheditcontrol runtime. If you usericheditvia CRichEditCtrl,CRichEditView, orCRichEditDoc, you don't need to call this function。
还有很多人建议更通用的:InitCommonControls() & InitCommonControlsEx()
- RichEdit导致Dialog初始化失败
- 错误修改初始化参数文件导致oracle启动失败!
- module初始化顺序导致的AKM8963C 磁传感器probe失败
- sql_mode导致初始化mariadb-10.0.6失败的一个问题
- log4crc和log4c版本不匹配导致log4c初始化失败
- 缺少{}导致的camera 初始化 iic通信失败
- RichEdit控件导致DoModal窗口不出现
- RichEdit导致到应用程序无法启动
- RichEdit
- richedit
- RichEdit
- RichEdit
- richedit
- RichEdit
- RichEdit
- RichEdit
- RichEdit
- KB2446710更新(x64)导致VS2008工具箱初始化失败(VS2008无法启动)
- 有个名,在心里一辈子
- 应付票据审核生成的付款单有什么作用,实际应付票据付款时如何操作?
- DWL-2100AP 默认登录帐号密码
- 程序员有趣的面试智力题
- 开学第一周
- RichEdit导致Dialog初始化失败
- 如何理解“已出库未开票”?
- 业务比较复杂的情况下使用游标
- Silverlight Rectangle控件鼠标移入时的提示框
- 牛b和不牛b有什么区别
- 使用ApacheBench做网站压力测试
- 我的“淘”生活
- ucGUI 移植
- 索引