Dialog Boxes

Standard dialog boxes to handle commonly performed user dialogs may also be generated and placed in dynamic link libraries. The inclusion of a dialog box in a DLL however, is slightly more complicated than the inclusion of a "normal" display or object window, due to the definition of the dialog template as a Presentation Manager resource. The DLL must therefore include not only the dialog procedure and the invoking routine, but also the dialog template definition.

This necessitates the invoking routine within the DLL not only executing the WinDlgBox() function call, but also obtaining a module handle for the DLL and an entry point address for the dialog procedure. The necessary steps are as follows:

  • The dialog procedure and the invoking routine are developed and placed in a dynamic link library.

  • The invoking routine is declared as an exportable entry point and may thus be called by applications.

  • The dialog template is created using the Dialog Box Editor, resource compiled and combined with the DLL.

    The invoking routine for a dialog box loaded from a DLL is described, along with an example, in Figure "Loading a Dialog Resource From a DLL".


    [Back: Subclassing]
    [Next: Generic Subroutines]