The following are the functions and utilities that control library locking.
You can disable library locking throughout your application by calling se_dllocking():
|
Warning: In order to avoid library corruption, you should not turn library locking OFF in a multi-user system unless you make the library READONLY using the Vermont Views System Administrator Utility (vvdadm.exe). Note, however, that the Designer cannot access a READONLY library.
There is no safe way to turn library locking OFF while a program is under development in a multi-user system. When you are ready to distribute your application, you can either turn library locking off by calling se_dllocking(), or make the library READONLY by using the System Administrator.
By default, dl_fmget(), dl_mnget(), and dl_wnget() lock the library before reading a form, menu, or window, and unlock it before returning. The process of locking and unlocking the library is slow. If your application reads several forms, menus, and/or windows at the same time, you can speed up the application by manually locking and unlocking the library yourself with sdl_lock():
|
||
|
|
|
|
|
|
Use this function to lock the library. dl_fmget(), dl_mnget() and dl_wnget() check whether the library is already locked; if so, they do not attempt to lock it again or unlock it before returning. After you have read all your forms, menus, and windows from the library, call sdl_lock() again to unlock the library. In this manner, you can ensure that the library is only locked and unlocked once.
Caution: If you have disabled library locking with se_dllocking(), you cannot lock or unlock a library with sdl_lock().
When distributing your application, it is best to provide a READONLY version of the Designer library along with the executable, help, and other files. If you do this, you are guaranteed that the Designer library cannot be written to, even by the Designer.
If the Designer library is READONLY, any code in the application that deals with locking or unlocking is ignored. Thus, the following is true:
Since locking and unlocking is not done if the Designer library is READONLY, setting the library to READONLY has time-saving advantages.
However, you cannot make the library READONLY during the development stages because the Designer also respects the READONLY status. Note that you can use library locking in any method you wish in your code, either automatic or manual, because these settings will be ignored once the library is READONLY.
To make the library READONLY, use the Designer System Administrator Utility. See the Designer User's Guide for details. Do not make the file READONLY by setting the file attributes for the library.