Initializing the Help Structures

Before help_proc() can be called, the help structure (or structures) must be initialized.

For data entry and menu applications, this is done for you in the help event functions, kd_help() and kc_help(). Functions kd_help() and kc_help() initialize two help structures, one for the first-level help and one for the second-level of help. The only exception is when kc_help() is called from within a stand-alone choice list; in this case, only one level of help is initialized.

The help structures are initialized according to the value of the help structure members in the choice list, field, scrollable region, or form. The help string pointer from the field (data, memo, or menu) or choice list is placed in the first-level help structure. The help string from the data form, menu form, or scrollable region is placed in the second-level help structure. A pointer to the second-level help structure is placed in the first-level help structure.

typedef struct help_struc

{
 
    UINT tag;
/* Sentinel
*/
    WINDOWPTR wnp;
/* Pointer to the help window
*/
    int nextact;    
/* Next action code
*/
    UCHAR *kwdp;
/* Pointer to keyword string
*/
    struct help_struc *nexthelp;
/* Pointer to next help structure
*/
} HELP, *HELPPTR;
   

To initialize this structure yourself, so that you can call help_proc() directly, set the kwdp member to point to the correct help keyword. If you want more than one level of help, declare another help structure and set nexthelp in the first help structure to point to the second help structure. Do not attempt to use the tag, wnp, or nextact structure members. help_proc() sets wnp to point to the global help window HELP_WNP, and sets tag and nextact to the values it needs.


Home Contents Previous Next