关于creat

caiyan807 2008-09-02 12:02:42
我要在主队对话框creat一个dialog,应该在CLightlevelDlg::OnInitDialog()里用m_wait.Create(IDD_DIALOG1,?),第二个参数怎么写?
...全文
113 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
WindAndSnow 2008-09-02
  • 打赏
  • 举报
回复
第二个参数是父窗口的指针,NULL表示没有父窗口,this表示当前窗口,也可以是其他指针
ostrich2fly 2008-09-02
  • 打赏
  • 举报
回复

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,this);
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
pDialog->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
}


MSDN上的东西,怎么不自己看

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧