CdlErrorConstants enumeration
The run-time error numbers that the methods of CommonDialog raise when a dialog fails or the user cancels it.
The enumeration is declared inside the CommonDialog class. Its members are used without a qualifier, or with the name of the enumeration. The numbers are those of the VB6 CommonDialog control (cdlCancel and the other cdl constants), not the codes that the Windows common-dialog library reports: the class translates the Windows code of a failure into the member that matches it. A failure for which there is no member raises an error whose number is the Windows code and whose description is “Unexpected error.”
No property takes or returns a member. A handler reads them from Err.Number.
| Member | Value | Description |
|---|---|---|
| CdlCancel | 32755 | The user closed the dialog with Cancel. The error is raised only when CancelError is True. |
| CdlBufferTooSmall | 20476 | The buffer for the file name is too small for the name that the user chose. The size of the buffer is MaxFileSize. |
| CdlInvalidFileName | 20477 | The file name is not valid. |
| CdlSubclassFailure | 20478 | The dialog could not subclass a list box because the system had too little memory. |
| CdlMaxLessThanMin | 24573 | The Font dialog was asked to limit the size, and Max is less than Min. |
| CdlNoFonts | 24574 | The Font dialog found no fonts to list. |
| CdlPrinterNotFound | 28660 | The [devices] section of WIN.INI has no entry for the printer. |
| CdlCreateICFailure | 28661 | The dialog could not create an information context for the printer. |
| CdlDndmMismatch | 28662 | The device mode and the device names describe two different printers. |
| CdlNoDefaultPrn | 28663 | The computer has no default printer. |
| CdlNoDevices | 28664 | The computer has no printer drivers. |
| CdlInitFailure | 28665 | The dialog failed while it was starting up. ShowPrinterEx raises this error for a failure of the extended Print dialog that has no member of its own. |
| CdlGetDevModeFail | 28666 | The printer driver could not fill in the device mode. |
| CdlLoadDrvFailure | 28667 | The dialog could not load the driver of the printer. |
| CdlRetDefFailure | 28668 | CdlPDReturnDefault or CdlPSDReturnDefault was set, but a field that must be zero was not. |
| CdlParseFailure | 28669 | The dialog could not read the strings in WIN.INI. |
| CdlHelp | 32751 | The call of the WinHelp viewer failed. |
| CdlBufferLengthZero | 36848 | A buffer of the Find or Replace dialog is not valid. |
Used by
- CommonDialog class, the methods that raise them:
- CdlCancel: ShowOpen, ShowSave, ShowColor, ShowFont, ShowPrinter, ShowPrinterEx, ShowPageSetup and ShowFolderBrowser
- CdlBufferTooSmall, CdlInvalidFileName and CdlSubclassFailure: ShowOpen and ShowSave
- CdlMaxLessThanMin and CdlNoFonts: ShowFont
- CdlPrinterNotFound, CdlCreateICFailure, CdlDndmMismatch, CdlNoDefaultPrn, CdlNoDevices, CdlInitFailure, CdlGetDevModeFail, CdlLoadDrvFailure, CdlRetDefFailure and CdlParseFailure: ShowPrinter and ShowPageSetup; ShowPrinterEx raises only CdlInitFailure
- CdlHelp: ShowHelp
- CdlBufferLengthZero: ShowFind and ShowReplace
See Also
- Enumerations – all the enumerations of the package
- CommonDialog class