主题:CPrppertySheet 实例化后怎么hWnd 是0
对话框程序中加一个按钮Button1.类CMyPropertySheet 从http://www.vckbase.com/document/viewdoc/?id=1805获得
CServerPge 、CUserPge是CPropertyPage派生的,现在问题是myps的hwnd是0.
另外再问个问题:派生CServerPge出现enum { IDD = _UNKNOWN_RESOURCE_ID_ };(编译不过去)后来我手工改成enum { IDD = ID_UerPage }; 并修改资源编译成功了. 请问在MFC中CServerPge应该怎么创建。请写出正确步骤
void CMyDlg::OnButton1()
{
CMyPropertySheet myps(_T("选项"),this,0);
CServerPge m_pgeServer;
CUserPge m_pgeUser;
myps.AddPage(&m_pgeServer);
myps.AddPage(&m_pgeUser);
myps.AddIcon(::LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_GLOBAL)));
myps.AddIcon(::LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ADDITION)));
myps.DoModal();
}
CServerPge 、CUserPge是CPropertyPage派生的,现在问题是myps的hwnd是0.
另外再问个问题:派生CServerPge出现enum { IDD = _UNKNOWN_RESOURCE_ID_ };(编译不过去)后来我手工改成enum { IDD = ID_UerPage }; 并修改资源编译成功了. 请问在MFC中CServerPge应该怎么创建。请写出正确步骤
void CMyDlg::OnButton1()
{
CMyPropertySheet myps(_T("选项"),this,0);
CServerPge m_pgeServer;
CUserPge m_pgeUser;
myps.AddPage(&m_pgeServer);
myps.AddPage(&m_pgeUser);
myps.AddIcon(::LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_GLOBAL)));
myps.AddIcon(::LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_ADDITION)));
myps.DoModal();
}