Previous Page Contents Page Next Page

2.8 Windows Environment Considerations

This section summarizes processing considerations of which you must be aware when developing LUA applications on a Windows client.

2.8.1 Multiple Sessions and Multiple Tasks

A single task may simultaneously use more than one LUA session, by issuing multiple RUI_INIT verbs. Each session must use a different LU, but two or more sessions may use the same pool.

Two or more instances of the same LUA application can be run as different tasks, but they must use different LUs. This can be done by using LU pools; the two tasks can specify the same pool, and will be allocated different LUs from that pool.

2.8.2 Compiling and Linking LUA Programs

This section provides information about compiling and linking LUA programs on a Windows client.

Compiler Options for Structure Packing

The VCB structures for LUA verbs are not packed. Do not use compiler options that change this packing method.

DWORD parameters are on DWORD boundaries, WORD parameters are on WORD boundaries, and BYTE parameters are on BYTE boundaries.

Header File

The header file to be included in Windows LUA applications is named winlua.h. This file is installed in the subdirectory /sdk within the directory where you installed the Windows Client software.

Load-Time Linking

To link the program to LUA at load time, link the program to the winrui32.lib library.

Run-Time Linking

To link the program to LUA at run-time, include the following calls in the program:

  • LoadLibrary to load the LUA dynamic link library winrui32.dll.

  • GetProcAddress to specify each of the LUA entry points required (such as WinRUI, WinRUIStartup, and WinRUICleanup)

  • FreeLibrary when the library is no longer required.

2.8.3 Terminating Applications

If an application must close (for example, if it receives a WM_CLOSE message as a result of an ALT F4 from a user), it should call the WinRUICleanup function before terminating. If it does not do this, then the application is left in an indeterminate state, although as much cleanup as possible is done when the Windows LUA software detects that the application has terminated.

Previous Page Contents Page Top of Page Next page