Windows NT Systems Programming: Spring 2000

[ Home | Syllabus | Course Notes | Assignments | Search]


Dialog Boxes (Chapter 6)

Two critical questions any software designer should ask are:

  1. Which object should remember this information
  2. Which object is responsible for making this happen.

Three Simple Dialog

To illustrate some of the difficulties in building a good dialog box and the advantage of reusing CDialog object from the MFC library and the use of the Resource/Dialog Editor and Class Wizard, I present three versions of a simple dialog to ask the user for a new title for the main window.

  1. Version one does not use CDialog, but builds the dialog in the main window itself. This is not a good solution but it does clearly illustrate the communications between CEdit and CButton controls.

  2. Version two uses CDialog and the Dialog editor and illustrates how to incorporate a resource compiler generated dialog into your program. Illustrates passing of data from Edit to MainWindow.

  3. Version three uses the app and class wizard and most closely follows the example in the book. Hopefully some the magic going on behind the scenes will make sense.

 


The book has a interesting dialog that incorporates most of the basic controls.
See source here.

And an even more interesting one that requires user programming to work.
See source here.


Copyright chris wild 1999/2000.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: January 25, 2000.