CommDlgExtendedError function (commdlg.h)
Returns a common dialog box error code. This code indicates the most recent error to occur during the execution of one of the common dialog box functions.
Syntax
DWORD CommDlgExtendedError();
Return value
Type: DWORD
If the most recent call to a common dialog box function succeeded, the return value is undefined. If the common dialog box function returned FALSE because the user closed or canceled the dialog box, the return value is zero. Otherwise, the return value is a nonzero error code.
The CommDlgExtendedError function can return general error codes for any of the common dialog box functions. In addition, there are error codes that are returned only for a specific common dialog box. All of these error codes are defined in Cderr.h. The following general error codes can be returned for any of the common dialog box functions.
Return code/value | Description |
---|---|
|
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 dialog box call specifies an invalid window handle. |
|
The common dialog box function failed to find a specified resource. |
|
The common dialog box function failed during initialization. This error often occurs when sufficient memory is not available. |
|
The common dialog box function failed to load a specified resource. |
|
The common dialog box function failed to load a specified string. |
|
The common dialog box function failed to lock a specified resource. |
|
The common dialog box function was unable to allocate memory for internal structures. |
|
The common dialog box function was unable to lock the memory associated with a handle. |
|
The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding instance handle. |
|
The ENABLEHOOK flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a pointer to a corresponding hook procedure. |
|
The ENABLETEMPLATE flag was set in the Flags member of the initialization structure for the corresponding common dialog box, but you failed to provide a corresponding template. |
|
The RegisterWindowMessage function returned an error code when it was called by the common dialog box function. |
|
The lStructSize member of the initialization structure for the corresponding common dialog box is invalid. |
The following error codes can be returned for the PrintDlg function.
Return code/value | Description |
---|---|
|
The PrintDlg function failed when it attempted to create an information context. |
|
You called the PrintDlg function with the DN_DEFAULTPRN flag specified in the wDefault member of the DEVNAMES structure, but the printer described by the other structure members did not match the current default printer. This error occurs when you store the DEVNAMES structure, and the user changes the default printer by using the Control Panel.
To use the printer described by the DEVNAMES structure, clear the DN_DEFAULTPRN flag and call PrintDlg again. To use the default printer, replace the DEVNAMES structure (and the structure, if one exists) with NULL; and call PrintDlg again. |
|
The data in the DEVMODE and DEVNAMES structures describes two different printers. |
|
The printer driver failed to initialize a DEVMODE structure. |
|
The PrintDlg function failed during initialization, and there is no more specific extended error code to describe the failure. This is the generic default error code for the function. |
|
The PrintDlg function failed to load the device driver for the specified printer. |
|
A default printer does not exist. |
|
No printer drivers were found. |
|
The PrintDlg function failed to parse the strings in the [devices] section of the WIN.INI file. |
|
The [devices] section of the WIN.INI file did not contain an entry for the requested printer. |
|
The PD_RETURNDEFAULT flag was specified in the Flags member of the PRINTDLG structure, but the hDevMode or hDevNames member was not NULL. |
|
The PrintDlg function failed to load the required resources. |
The following error codes can be returned for the ChooseFont function.
Return code/value | Description |
---|---|
|
The size specified in the nSizeMax member of the CHOOSEFONT structure is less than the size specified in the nSizeMin member. |
|
No fonts exist. |
The following error codes can be returned for the GetOpenFileName and GetSaveFileName functions.
Return code/value | Description |
---|---|
|
The buffer pointed to by the lpstrFile member of the OPENFILENAME structure is too small for the file name specified by the user. The first two bytes of the lpstrFile buffer contain an integer value specifying the size required to receive the full name, in characters. |
|
A file name is invalid. |
|
An attempt to subclass a list box failed because sufficient memory was not available. |
The following error code can be returned for the FindText and ReplaceText functions.
Return code/value | Description |
---|---|
|
A member of the FINDREPLACE structure points to an invalid buffer. |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | commdlg.h (include Windows.h) |
Library | Comdlg32.lib |
DLL | Comdlg32.dll |
API set | ext-ms-win-shell-comdlg32-l1-1-0 (introduced in Windows 10, version 10.0.10240) |
See also
Conceptual
Reference