引言:今天看MicrosoftDoc关于CFileDialog的doModal函数返回值的部分,提到了实际上MFC提供了错误信息显示。
个人技术博客(文章整理+源码): zobol的windows编程教程 | LearnWinAPI
1.用法:
CFileDialog::DoModal的返回值IDOK或IDCANCEL。如果返回IDCANCEL,请调用Windows CommdLGextenderror函数以确定是否发生错误。
CommDlgExtendedError函数可以返回任何常见对话框函数的常规错误代码。如果由于用户关闭或取消了对话框,公共对话框函数返回FALSE,则返回值为零。否则,返回值为非零错误代码。此外,还存在仅针对特定公用对话框返回的错误代码。所有这些错误代码都在Cderr中定义。h、 对于任何常用对话框函数,都可以返回以下常规错误代码。
2.错误类型:
CDERR_DIALOGFAILURE 0xFFFF:The dialog box could not be created. The common dialog box function's call to the DialogBox function failed. For example, this error occurs if the common dialo