CommDlgExtendedError

3.1

  #include <commdlg.h>    

  DWORD CommDlgExtendedError(void)    

The CommDlgExtendedError function identifies the cause of the most recent error to have occurred during the execution of one of the following common dialog box procedures:

ChooseColor

ChooseFont

FindText

GetFileTitle

GetOpenFileName

GetSaveFileName

PrintDlg

ReplaceText

Parameters

This function has no parameters.

Return Value

The return value is zero if the prior call to a common dialog box procedure was successful. The return value is CDERR_DIALOGFAILURE if the dialog box could not be created. Otherwise, the return value is a nonzero integer that identifies an error condition.

Comments

Following are the possible CommDlgExtendedError return values and the meaning of each:

Value Meaning

CDERR_FINDRESFAILURE Specifies that the common dialog box procedure failed to find a specified resource.
CDERR_INITIALIZATION Specifies that the common dialog box procedure failed during initialization. This error often occurs when insufficient memory is available.
CDERR_LOADRESFAILURE Specifies that the common dialog box procedure failed to load a specified resource.
CDERR_LOCKRESFAILURE Specifies that the common dialog box procedure failed to lock a specified resource.
CDERR_LOADSTRFAILURE Specifies that the common dialog box procedure failed to load a specified string.
CDERR_MEMALLOCFAILURE Specifies that the common dialog box procedure was unable to allocate memory for internal structures.
CDERR_MEMLOCKFAILURE Specifies that the common dialog box procedure was unable to lock the memory associated with a handle.
CDERR_NOHINSTANCE Specifies that the ENABLETEMPLATE flag was set in the Flags member of a structure for the corresponding common dialog box but that the application failed to provide a corresponding instance handle.
CDERR_NOHOOK Specifies that the ENABLEHOOK flag was set in the Flags member of a structure for the corresponding common dialog box but that the application failed to provide a pointer to a corresponding hook function.
CDERR_NOTEMPLATE Specifies that the ENABLETEMPLATE flag was set in the Flags member of a structure for the corresponding common dialog box but that the application failed to provide a corresponding template.
CDERR_REGISTERMSGFAIL Specifies that the RegisterWindowMessage function returned an error value when it was called by the common dialog box procedure.
CDERR_STRUCTSIZE Specifies as invalid the lStructSize member of a structure for the corresponding common dialog box.
CFERR_NOFONTS Specifies that no fonts exist.
CFERR_MAXLESSTHANMIN Specifies that the size given in the nSizeMax member of the CHOOSEFONT structure is less than the size given in the nSizeMin member.
FNERR_BUFFERTOOSMALL Specifies that the filename buffer is too small. (This buffer is pointed to by the lpstrFile member of the structure for a common dialog box.)
FNERR_INVALIDFILENAME Specifies that a filename is invalid.
FNERR_SUBCLASSFAILURE Specifies that an attempt to subclass a list box failed due to insufficient memory.
FRERR_BUFFERLENGTHZERO Specifies that a member in a structure for the corresponding common dialog box points to an invalid buffer.
PDERR_CREATEICFAILURE Specifies that the PrintDlg function failed when it attempted to create an information context.
PDERR_DEFAULTDIFFERENT Specifies that an application has called the PrintDlg function with the DN_DEFAULTPRN flag set in the wDefault member of the DEVNAMES structure, but the printer described by the other structure members does not match the current default printer. (This happens when an application stores the DEVNAMES structure and the user changes the default printer by using Control Panel.)
  To use the printer described by the DEVNAMES structure, the application should clear the DN_DEFAULTPRN flag and call the PrintDlg function again. To use the default printer, the application should replace the DEVNAMES structure (and the DEVMODE structure, if one exists) with NULL; this selects the default printer automatically.
PDERR_DNDMMISMATCH Specifies that the data in the DEVMODE and DEVNAMES structures describes two different printers.
PDERR_GETDEVMODEFAIL Specifies that the printer driver failed to initialize a DEVMODE structure. (This error value applies only to printer drivers written for Windows versions 3.0 and later.)
PDERR_INITFAILURE Specifies that the PrintDlg function failed during initialization.
PDERR_LOADDRVFAILURE Specifies that the PrintDlg function failed to load the device driver for the specified printer.
PDERR_NODEFAULTPRN Specifies that a default printer does not exist.
PDERR_NODEVICES Specifies that no printer drivers were found.
PDERR_PARSEFAILURE Specifies that the PrintDlg function failed to parse the strings in the [devices] section of the WIN.INI file.
PDERR_PRINTERNOTFOUND Specifies that the [devices] section of the WIN.INI file did not contain an entry for the requested printer.
PDERR_RETDEFFAILURE Specifies that the PD_RETURNDEFAULT flag was set in the Flags member of the PRINTDLG structure but that either the hDevMode or hDevNames member was nonzero.
PDERR_SETUPFAILURE Specifies that the PrintDlg function failed to load the required resources.

For more information about the CommDlgExtendedError function, see the Microsoft Windows Programmer's Reference, Volume 1.

See Also

ChooseColor, ChooseFont, FindText, GetFileTitle, GetOpenFileName, GetSaveFileName, PrintDlg, ReplaceText