library

This statement describes a type library. This description contains all of the information in a MkTypLib input file (ODL).

Syntax

[attributes] library libname {
    definitions
};

Syntax Elements

attributes
The helpstring, helpcontext, lcid, restricted, hidden, control, and uuid attributes are accepted before a library statement. For more information about the attributes accepted before a library definition, see "Attribute Descriptions" earlier in this chapter. The uuid attribute is required.
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.

Comments

The library statement must precede any other type definitions.

Example

[
    uuid(F37C8060-4AD5-101B-B826-00DD01103DE1), // LIBID_Hello.
    helpstring("Hello 2.0 Type Library"),
    lcid(0x0409),
    version(2.0)
]
library Hello
{
    importlib("stdole.tlb"); 
    [
        uuid(F37C8062-4AD5-101B-B826-00DD01103DE1),    // IID_Ihello.
        helpstring("Application object for the Hello application."),
        oleautomation,
        dual
    ]
    interface IHello : IDispatch
    {
        [propget, helpstring("Returns the application of the object.")]
        HRESULT Application([in, lcid] long localeID, 
            [out, retval] IHello** retval)
    }
}