Compartir a través de


Type Library Access

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Type Library Access.

Type libraries expose the interfaces of an OLE control to other OLE-aware applications. Each OLE control must have a type library if one or more interfaces are to be exposed.

The following macros allow an OLE control to provide access to its own type library:

Type Library Access

DECLARE_OLETYPELIB Declares a GetTypeLib member function of an OLE control (must be used in the class declaration).
IMPLEMENT_OLETYPELIB Implements a GetTypeLib member function of an OLE control (must be used in the class implementation).

DECLARE_OLETYPELIB

Declares the GetTypeLib member function of your control class.

DECLARE_OLETYPELIB
(class_name)   

Parameters

class_name
The name of the control class related to the type library.

Remarks

Use this macro in the control class header file.

IMPLEMENT_OLETYPELIB

Implements the control's GetTypeLib member function.

IMPLEMENT_OLETYPELIB
(class_name, tlid, wVerMajor,  wVerMinor)   

Parameters

class_name
The name of the control class related to the type library.

tlid
The ID number of the type library.

wVerMajor
The type library major version number.

wVerMinor
The type library minor version number.

Remarks

This macro must appear in the implementation file for any control class that uses the DECLARE_OLETYPELIB macro.

See Also

Macros and Globals