Using Another Library's Logical Attribute Array with a Window

You can use another logical attribute array in the linked list instead of the array from the library in which the window is stored. To associate another logical attribute array with a window, you first get a pointer to the logical attribute array for the library by calling dl_lattp(), and then associate the logical attribute array with the window by calling sw_latt(). The calling sequences for these two functions are as follows:

UCHAR *dl_lattp(libname_stp)

UCHAR *libname_stp;        /* Name of Designer library        */

dl_lattp() returns a pointer to the logical attribute array for the specified library. 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. If the logical attribute array is not available and you are using the development libraries, an error is reported.

void sw_latt(latt_array, wnp)
 
UCHAR latt_array[];
/* Logical attribute array 
*/
WINDOWPTR wnp;
/* Pointer to window 
*/

sw_latt() associates the specified logical attribute array with the window.

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

WINDOWPTR wnp;

DLIBPTR libp;

UCHAR *lattp;



libp = dl_open("testlib.vvd");

wnp = dl_wnget("testwn", libp);

dl_close(libp);

libp = dl_open("account.vvd");

lattp = dl_lattp("account.vvd");

sw_latt(lattp, wnp);

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. Also, since there are no forms from this library using this logical attribute array, you must leave the library open until this window is freed, or until you associate another logical attribute array with this window.


Home Contents Previous Next