CPropertySheet用法
ooicc 2014-08-05 07:21:32 我贴代码吧,省的说不清:
加的东西几乎没有,为了测试
CMyPropertySheet 头文件
class CMyPropertySheet : public CPropertySheet
{
DECLARE_DYNAMIC(CMyPropertySheet)
public:
CMyPropertySheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CMyPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
virtual ~CMyPropertySheet();
C1Page m_page;//向导自动生成,一个东西都没加,对话框模版也啥都没加
protected:
DECLARE_MESSAGE_MAP()
};
CMyPropertySheet cpp文件
IMPLEMENT_DYNAMIC(CMyPropertySheet, CPropertySheet)
CMyPropertySheet::CMyPropertySheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
AddPage(&m_page);
}
CMyPropertySheet::CMyPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&m_page);
}
CMyPropertySheet::~CMyPropertySheet()
{
}
BEGIN_MESSAGE_MAP(CMyPropertySheet, CPropertySheet)
END_MESSAGE_MAP()
// CMyPropertySheet 消息处理程序
然后,第一次进入Propertysheet会写入访问冲突:
CMyPropertySheet dlg(_T("Options"));
dlg.DoModal();
这样的代码,问题在哪。。。。要疯了
再一个,我在MyPropertyPage里面放一个MFC ColorButton Control,MyPropertySheet窗口出不来,DoModal直接返回,进不了ContinueModal的循环,MFC ColorButton Control要咋用啊,有啥特别的吗?