CLGEN generates two set of classes: one set uses MFC classes; one set uses CLGEN interface customization classes. The CLGEN classes allow programmers change the appearance of the GUI objects. The two set of classes are basically one-one corresponded. For example: CDialog - CPictDialog, CButton - CPictButton, etc.

There is a checkbox in the CLGEN program to toggle between the two set of classes. If "Picture Background" is checked, CLGEN classes will be generated; otherwise MFC classes will be generated.

All dialog related classes require a dialog template starting with IDD_ before they can be generated. These include: CDialog, CFormView, CPropertyPage, and CDialogBar. CPropertySheet class is normally generated together with one or more pages, each page needs one dialog template.

CToolBar class needs a toolbar template starting with IDR_.

Dialog, FormView, PropertyPage, DialogBar Generation:

Close Visual C++ project work space before generating new class. Then select a menu choice and enter necessary information:

Resource Path File - enter the RC file (or use button to select) which contains the dialog template.
H and CPP Path File - enter the to be generated class' file name. The H and CPP file use the same file name.
Class Name - name for the to be generated class.
Base Class - base class name, it is automatically selected based on the class type.
Dialog ID - select a dialog template to be associated with the to be generated class.
Add Class Into Project - the to be generated class will be added into the project if "Yes" is checked. Only do this for the new Visual C++ version (version 5).

Next step is to tell where to call the generated class.

Calling Path File - the file to insert the calling code.
Calling Class Name - the class inside the file to insert the calling code.
Calling Func Name - the function inside the class from where to call the generated class.
Calling Var Name - the variable name for the called class. CLGEN will make one if no variable name is entered.

If Cancel button is clicked here, no calling code will be created, but the new class specified in the first dialog will still be generated.

All the to be modified files are backed up before modification. Modal dialog only modifies ".cpp" file, while modeless dialog will modify both ".h" and ".cpp" files. Normally, form view class is called from InitInstance inside the main application cpp; dialog bar is created in the OnCreate of mainfrm cpp.

PropertyPage Sheet Generation:

Besides going through the above two dialog data input, property sheet class has one more input dialog to get property page information:

Up to ten property pages can be generated tegother with the property sheet class. Each line in the grid specifies information for one page: page's dialog template, page's file name, page's class name, and page's base class name. If Cancel button is clicked here, no page class will be produced, only sheet class will be generated.

ToolBar Generation:

Toolbar is created in CMainFrame class and its button handlers are also written in this class. There is no separate class file for toolbar. The data input dialog is:

Resource Path File - enter the RC file which contains the toolbar template.
MainFrame Path File - file of the mainframe, "MainFrm" is default.
MainFrame Class - class name of the mainframe, "CMainFrame" is defualt.
Toolbar ID - select a toolbar template to be associated with the toolbar.
Variable - the variable name for the toolbar. CLGEN will make one if no variable name is entered.

After entering data is completed, CLGEN will generate the new classes and modify the existing class in a second. Then just go to compile and run your project. If your project needs JPICT or JEDIT DLLs, CLGEN will automatically copy them and insert them into your project.