Freigeben über


library

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

Syntax

[attributes] library libname {
   definitions
};

attributes

The helpstring, helpcontext, lcid, restricted, hidden, control, uuid and version attributes are accepted before a library statement. 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.

Remarks

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)
   }
}