Using Another Library's Logical Attribute Array with a Form

You can use another logical attribute array in the linked list instead of the array from the library in which the form is stored. To associate another logical attribute array with a form, use the set form logical attributes function, sfm_latt():

void sfm_latt(libname_stp, fmp)
 
UCHAR *libname_stp;
/* Designer library name
*/
FORMPTR fmp;
/* Pointer to form
*/

This function associates the logical attribute array for the specified library with the form and its associated windows. The logical attribute array for the library name you specify must already be in the linked list. This means that either (1) the specified library is open or (2) a form or window still in memory is using the logical attribute array for the specified library.

For example, if you have the form testfm in the library testlib.vvd and you want to use the logical attribute array from the library account.vvd, you can do the following:

DFORMPTR dfmp;

DLIBPTR libp;

libp = dl_open("testlib.vvd");

dfmp = dl_fmget("testfm", NULLP, NULLP, NULLP, libp);

dl_close(libp);

libp = dl_open("account.vvd");

sfm_latt("account.vvd", dfmp);

dl_close(libp);

Note that you must open the library before you can use the logical attribute array from the account library since there are no forms currently using the account.vvd logical attribute array.

Continuing with the above example, if you want to use the logical attribute array from the account.vvd library for both a form from the library and testfm, you can do the following:

DFORMPTR testfmp;

DFORMPTR acctfmp;

DLIBPTR libp;

libp = dl_open("testlib.vvd");

testfmp = dl_fmget("testfm", NULLP, NULLP, NULLP, libp);

dl_close(libp);

libp = dl_open("account.vvd");

acctfmp = dl_fmget("acctfm", NULLP, NULLP, NULLP, libp);

dl_close(libp);

sfm_latt("account.vvd", testfmp);

Note that when sfm_latt() was called, the form acctfm was still in use. Thus, even though the library account.vvd was closed, the logical attribute array for account.vvd was in use.


Home Contents Previous Next