Type Library Attributes

The following keywords specify type library information within the context of a library statement in an IDL file.

Attribute Usage
aggregatable Defines the coclass as supporting objects that can directly expose another object's interface pointer.
appobject Identifies the coclass as an application object, which is associated with a full EXE application.
bindable Indicates that the property supports data binding. This allows the client to be notified whenever a property has changed value.
coclass Provides a listing of the supported interfaces for a component object.
control Identifies a coclass or library as a COM control, from which a container site will derive additional type libraries or component object classes.
custom Defines a custom attribute (one not defined in MIDL).
default Indicates that the interface or dispinterface, defined within a coclass, represents the default interface.
defaultbind Indicates the single, bindable property that best represents the object.
defaultcollelem Flags the property as an accessor function for an element of the default collection. Used for Microsoft Visual Basic code optimization.
defaultvalue Allows specification of a default value for a typed optional parameter.
defaultvtable Allows an object to have two different source interfaces.
dispinterface Defines a set of properties and methods on which you can call IDispatch::Invoke.
displaybind Indicates a property that should be displayed to the user as bindable.
dllname(str) Defines the name of the DLL that contains the entry points for a module.
dual Identifies an interface that exposes properties and methods both through IDispatch and directly through the Vtable.
entry Specifies an exported function or constant in a module by identifying the entry point in the DLL.
helpcontext Specifies a context identifier that lets the user view information about this element in the Help file.
helpfile Sets the name of the Help file for a type library.
helpstring Specifies a character string that is used to describe the element to which it applies.
helpstringdll Sets the name of the DLL to use to perform the document string lookup.
hidden Indicates that the item exists but should not be displayed in a user-oriented browser.
id Specifies a DISPID for a member function (either a property or a method, in an interface or dispinterface).
immediatebind Indicates that the database will be notified immediately of all changes to a property of a data-bound object.
lcid When applied to the library statement, along with a localeID argument, identifies the locale for a type library or for a function argument and lets you use international characters inside the library block. Within a library statement, from the point where the lcid attribute is used, MIDL will accept input localized according to the specified locale.
library Instructs the MIDL compiler to generate type library information for the interfaces and classes referenced inside the statement.
licensed Indicates that the coclass to which it applies is licensed, and instances must be created using IClassFactory2.
nonbrowsable Indicates that the property appears in an object browser (which does not show property values), but does not appear in a properties browser (which does show property values).
noncreatable Prevents a client from using the default class factory to create instances of an object interface.
nonextensible Specifies that the IDispatch implementation includes only the properties and methods listed in the interface description and cannot be extended with additional members at runtime.
oleautomation Indicates that an interface is compatible with automation.
optional Specifies an optional parameter for a member function.
propget Specifies a property accessor function.
propput Specifies a property-setting function.
propputref Specifies a property-setting function that uses a reference instead of a value.
public Ensures that an alias declared with typedef becomes part of the type library.
readonly Prohibits assigning a new value to a variable.
requestedit Indicates that the property supports the OnRequestEdit notification.
restricted Specifies that a library, or member of a module, interface, or dispinterface cannot be called arbitrarily.
retval Designates the parameter that receives the return value of the member.
source Indicates that a member of a coclass, property, or method is a source of events.
string Indicates that the one-dimensional char, wchar_t, byte (or equivalent) array or the pointer to such an array must be treated as a string.
uidefault Indicates that the type information member is the default member for display in the user interface.
usesgetlasterror Specifies that a module entry point uses SetLastError to return error codes and that a caller can then call GetLastError to retrieve the error code if there is an error on entering a function.
uuid Designates a unique identifier for a type library, coclass, or interface.
vararg Specifies that the function takes a variable number of arguments.
version Identifies a particular version of a type library.


ODL File Syntax

ODL File Example

Generating a Type Library With MIDL