Microsoft KB Archive/162160

= FIX: CFileDialog::DoModal Does Not Return 0 =

Article ID: 162160

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 2.1

 Microsoft Visual C++ 2.2

 Microsoft Visual C++ 4.0 Standard Edition</li></ul>

 Microsoft Visual C++ 4.1 Subscription</li></ul>

 Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q162160

<div class="symptoms_section">

SYMPTOMS
The documentation for the Class Library Reference distributed with Visual C++ is incorrect. The documentation states:

IDOK or IDCANCEL if the function is successful; otherwise 0. IDOK and IDCANCEL are constants that indicate whether the user selected the OK or Cancel button.

If IDCANCEL is returned, you can call the Windows CommDlgExtendedError function to determine whether an error occurred.

The corrected documentation should read:

IDOK or IDCANCEL. If IDCANCEL is returned, you can call the Windows CommDlgExtendedError function to determine whether an error occurred.

IDOK and IDCANCEL are constants that indicate whether the user selected the OK or Cancel button.

<div class="status_section">

STATUS
This problem was corrected in the documentation for Visual C++, version 6.0.

<div class="moreinformation_section">

MORE INFORMATION
This correction applies to the documentation for the following MFC common dialog classes: CFileDialog, CColorDialog, CFontDialog, CPageSetupDialog, CPrintDialog, and CFindReplaceDialog.

NOTE: 0 is not a legitimate return value for the MFC common dialog DoModal member function.

Additional query words: CfileDialog CColorDialog CfontDialog CPageSetupDialog CPrintDialog CFindReplaceDialog

Keywords: kbbug kbcmndlg kbdocerr kbdocs kbfix kbnoupdate kbui kbuidesign kbvc600fix KB162160

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.