DOCERR: Using IDABORT w/ GetOpenFileName & GetSaveFileName

Last reviewed: March 2, 1995
Article ID: Q85174
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SYMPTOMS

If an application uses the IDABORT value to end the GetOpenFileName() or GetSaveFileName() dialog boxex provided by the common dialog box library (COMMDLG), the application does not receive the proper value.

RESOLUTION

Set the lCustData member of the OPENFILENAME structure to the desired return value. If lCustData is used to transfer some other data, use a global variable to pass the return value.

MORE INFORMATION

The IDABORT value is documented on page 157 of the "Microsoft Windows Software Development Kit: Programmer's Reference Volume 1: Overview" manual as follows:

   When a hook function posts the IDABORT value, the common dialog box
   function returns the value contained in the low word of the lParam
   parameter. For example, if the hook function for GetOpenFileName
   called the PostMessage function with (LONG) 100 as the last
   parameter, GetOpenFileName would return 100.

This information is not correct for the GetOpenFileName() and GetSaveFileName() dialog boxes mentioned above. The information is correct for all other modal dialog boxes provided by the common dialog boxes DLL.

Specifying IDOK in the low-order word of lParam causes GetOpenFileName() and GetSaveFileName() to return TRUE. Any other value causes these functions to return FALSE.


Additional reference words: 3.10 docerr
KBCategory: kbprg kbdocerr
KBSubcategory: UsrCmnDlg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.