Resolving External References for Menus

For your convenience, all external references made for a menu can be done when the menu is read from the library with dl_mnget(). The disadvantage of doing this is that you have less control over memory use; all sub-menu forms and associated data forms, if any, will be allocated when the menu is retrieved from the library.

As an alternative, you can resolve these references at another point in your program—as long as external references are resolved before the menu is processed. For instance, you may want to get all menus and forms out of the library at one time, thus opening and closing the library file only once (a comparatively slow operation). Then, you can resolve the external references for the menus and forms immediately before processing them. Alternatively, if the amount of free space in the heap is limited, you may wish to get forms and menus out of the library only when they are needed and then free them as soon as you are finished with them.

The tutorial des_mnxr.c shows how to write a program that resolves the external references made by the form in a routine different than the one where the menu is read.

More:

Resolving External References to Functions

Resolving External References to Sub-menus or Sub-forms


Home Contents Previous Next