[uuid [, optional-attribute-list]] library libname {definitions};
[uuid(. . .), helpstring("Hello 2.0 Type Library"),
lcid(0x0409), version(2.0)]
library Hello
{. . .};
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.
Generating a Type Library With MIDL, Contents of a Type Library, ODL File Syntax