显示对话框 [英] Displaying dialog box

查看:101
本文介绍了显示对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 -

Can I use-

CDialog *dlg;
dlg->DoModal();



显示对话框?


to display dialog box?

推荐答案

你不能那样使用它(你的程序会崩溃)。您可以这样使用它:



You can''t use it that way (your program will crash). You may use it this way:

// Allocate CDialog object on the heap.
// Object must be destroyed when no longer needed.
CDialog *pDlg = new CDialog;
pDlg->DoModal();
delete pDlg;

// Allocate CDialog object on the stack.
// Object is destroyed when going out of scope.
CDialog dlg;
dlg.DoModal();


这篇关于显示对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆