MFC中IDD_FORMVIEW的对话框如何嵌入到单文档文件中
我添加了加入资源对话框IDD_FORMVIEW我想在白色文档嵌入我的对话框IDD_FORMVIEW怎么做?...
我添加了加入资源 对话框 IDD_FORMVIEW
我想在白色文档嵌入我的对话框 IDD_FORMVIEW
怎么做? 展开
我想在白色文档嵌入我的对话框 IDD_FORMVIEW
怎么做? 展开
2个回答
展开全部
方法如下:
用CView*或者CFrameWnd*给他做父窗口 一般你是做成非模态对话框就用Create Example
CMyDialog* pDialog;
void CMyWnd::OnSomeAction()
{
//pDialog initialized to NULL in the constructor of CMyWnd class
pDialog = new CMyDialog();
//Check if new succeeded and we got a valid pointer to a dialog object
if(pDialog != NULL)
{
BOOL ret = pDialog->Create(IDD_MYDIALOG,/*父窗口*/);
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
pDialog->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
}
用CView*或者CFrameWnd*给他做父窗口 一般你是做成非模态对话框就用Create Example
CMyDialog* pDialog;
void CMyWnd::OnSomeAction()
{
//pDialog initialized to NULL in the constructor of CMyWnd class
pDialog = new CMyDialog();
//Check if new succeeded and we got a valid pointer to a dialog object
if(pDialog != NULL)
{
BOOL ret = pDialog->Create(IDD_MYDIALOG,/*父窗口*/);
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
pDialog->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询