关于CDialog::DoModal
2015-07-12 23:00
453 查看
CDialog::DoModal
virtual int DoModal( ); 虚函数Return Value 返回值
An int value that specifies the value of the nResult parameter that was passed to the
CDialog::EndDialog member function, which is used to close the dialog box. The return value is –1 if the function could not create the dialog box, or
IDABORT if some other error occurred.
一个标识nResult的int值作为参数传递给CDialog::EndDialog成员函数,这个函数用来关闭一个对话框。如果函数不能创建一个对话框,则返回-1,否则,如果其他错误发生的话,将返回IDABORT值
Remarks 注释
Call this member function to invoke the modal dialog box and return the dialog-box result when done. This member function handles all interaction with the user while the dialog box is active. This is what makes the dialog box modal; that is, the user cannot
interact with other windows until the dialog box is closed.
调用这个函数去产生一个模态对话框,且当完成后会返回对话框的结果。当此对话框在激活状态时,这个成员函数会处理用户与对话框的交互。除非这个对话框被关闭了,要不然用户没法与其他对话框完成交互。
If the user clicks one of the pushbuttons in the dialog box, such as OK or Cancel, a message-handler member function, such as
OnOK or OnCancel, is called to attempt to close the dialog box. The default
OnOK member function will validate and update the dialog-box data and close the dialog box with result
IDOK, and the default OnCancel member function will close the dialog box with result
IDCANCEL without validating or updating the dialog-box data. You can override these message-handler functions to alter their behavior.
如果用户点击了对话框上的按钮,如Ok或Cancel,将会调用对应的消息句柄成员函数,如OnOk或OnCancel,将会被调用,然后关闭这个对话框。默认的OnOk成员函数将会更新对话框的数据然后返回结果IDOK,接着关闭对话框。而默认的OnCancel成员函数将会返回结果IDCANCEL后关闭对话框,并不使得有效或是更新对话框数据,你可以重载这两个函数去改变他们的行为。
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android Native 绘图方法
- 如何重装TCP/IP协议
- 关于指针的一些事情
- Windows 8 官方高清壁纸欣赏与下载
- 谁是桌面王者?Win PK Linux三大镇山之宝
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷
- Windows Clang开发环境备忘
- 从Windows系统下访问Linux分区相关软件
- 对《大家都在点赞 Windows Terminal,我决定给你泼一盆冷水》一文的商榷
- c++ primer 第五版 笔记前言
- Visual Studio 2012 示例代码浏览器 - 数以千计的开发示例近在手边,唾手可得
- Visual Studio 2012 示例代码浏览器 - 数以千计的开发示例近在手边,唾手可得
- share_ptr的几个注意点
- 微软镜像下载
- windows server域用户提升到本地更高权限组中的方法
- 使用命令修改注册表键值及权限
- 通过手机、电脑远程开关机,Windows和linux机手机,电脑相互控制