关于CMFCColorDialog
VS2010下的MFC应用程序,选择了USE MFC in a static library,项目中我要弹出一个颜色对话框,用的是CMFCColorDialog.
CMFCColorDialog dlg(RGB(0,0,0),0,this);
dlg.DoModal();
奇怪的是,对话框弹不出来,跟进去,它说的是资源找不到。
而把USE MFC in a static library 改成use mfc in a shared dll ,一切都OK了。
——————————————————————————————————————————————
MFC应用程序向导生成的代码的一些选项不支持MFC Feature Pack新增的类。如果你要在面向对话框的MFC程序中使用MFC Feature Pack新增的类,需要在向导中更改基类为CDialogEx或者手动编辑rc文件
打开rc文件
在Edit菜单中选择resource includes
在Read only symbol directives里面加入
#if !defined(_AFXDLL)
#include "afxribbon.rc" // MFC ribbon and control bar resources
#endif