The LIBRARY Statement

The LIBRARY statement identifies the executable file as a DLL. It can also specify the name of the library and the type of library-module initialization required. The NAME or LIBRARY statement must precede all other statements. If LIBRARY is specified, the NAME statement cannot be used. If neither is used, the default is NAME.

Summary: Syntax

LIBRARY [[libraryname]] [[initialization]] [[PRIVATELIB]]

Summary: Remarks

The fields can appear in any order.

If libraryname is specified, it becomes the name of the library as it is known by Windows. This name can be any valid filename. If libraryname contains a space, begins with a nonalphabetic character, or is a reserved word, surround the name with double quotation marks. The name cannot exceed 255 characters. If libraryname is not specified, the DLL is given the same base name as the project file.

If initialization is specified, it determines the type of initialization required. For a Windows DLL, the initialization field can take only one value, INITGLOBAL (the default). This specifies that the library-initialization routine is called only when the library is initially loaded into memory.

If PRIVATELIB is specified, it tells Windows that only one application may use the DLL.

Summary: Example

The following example assigns the name calendar to the DLL being defined and explicitly specifies the initialization behavior:

LIBRARY calendar INITGLOBAL