Compaq Visual Fortran: A Guide to Creating Windows Applications

The common dialog box library promotes a standardized user interface that can be used from QuickWin or Win32 applications. This library consists of functions that include standard dialog boxes for opening and saving files, finding and replacing text, choosing fonts, and printing files. The USE commdlg32 statement must be included in any file that uses the common dialog box library. All the dialog boxes are modal with the exception of the find and replace dialog boxes, which are modeless so that when they are displayed, the focus can be with either the control or the application. Common dialog boxes are easy to display, although you need to write the code that is actually used to read, write, and print files; set fonts; change colors; and find or replace text. To use these dialog boxes, you must initialize the fields of a structure and pass a pointer to the structure to a function in the common dialog library. The function creates and displays the common dialog box. After the user makes a selection and closes the dialog box, control is returned to your program where, by examining the field members of the relevant structure, you can obtain information input by the user.
When an error occurs with the initialization or opening of a common control, the error can be obtained by calling the CommDlgExtendedError function, which returns an error value that identifies the cause of the most recent error. The online documentation contains information describing...