Düzenle

Aracılığıyla paylaş


library attribute

The library statement contains all the information that the MIDL compiler uses to generate a type library.

[
    uuid(uuid-number), 
    [, optional-attribute-list]
] 
library library-name
{ 
    library-definition-statements
}

Parameters

uuid-number

Specifies a universally unique identification number for the library.

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].

library-name

The name by which software components refer to the library.

library-definition-statements

One or more MIDL statements which define the contents of the library.

Remarks

Statements inside the library block can use elements that are declared inside or outside of the library block. Library statements can use those elements as base types, inheriting from those elements, or by simply referencing them on a line, as follows:

interface MyFace 
{
    // Interface definition statements
};

[
    // library attributes
] 
library
{
    interface MyFace;

    // Other library definition statements.
};

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.

Examples

[
    uuid(12345678-1234-1234-1234-123456789ABC), 
    helpstring("Hello 2.0 Type Library"), 
    lcid(0x0409), 
    version(2.0)
] 
library Hello 
{
    /* Library definition statements */
};

See also

Contents of a Type Library

control

Generating a Type Library With MIDL

helpcontext

helpfile

helpstring

hidden

lcid

ODL File Syntax

restricted

version