library

[uuid [, optional-attribute-list]] library libname {definitions};

optional-attribute-list
Specifies additional attributes that apply to the entire library statement. Allowable attributes include control, helpcontext, helpfile, helpstring, hidden, lcid, restricted, and version.
libname
The name by which the type library is known.
definitions
Descriptions of any imported libraries, data types, modules, interfaces, dispinterfaces, and coclasses relevant to the object being exposed.

Example

[uuid(. . .), helpstring("Hello 2.0 Type Library"), 
    lcid(0x0409), version(2.0)] 
library Hello 
{. . .}; 
 

Remarks

The library statement contains all the information that the MIDL compiler uses to generate a type library. In addition to elements defined inside of the library block, statements inside the library block can use elements that are declared outside of the library block by using those elements as base types, inheriting from those elements, or by simply referencing them on a line, as follows:

interface MyFace {. . .};
[library attributes] library
{
interface My Face;
};

The MIDL compiler will create a type library that includes definitions for every element inside the library block, plus definitions for any elements defined outside and referenced from within the library block.

For information on generating both a type library and proxy stubs and headers from a single IDL file see Generating a Proxy DLL and a Type Library From a Single IDL File.

See Also

Generating a Type Library With MIDL, Contents of a Type Library, ODL File Syntax