Skip to content

Files

Latest commit

0885606 · Oct 5, 2017

History

History
75 lines (58 loc) · 2.14 KB

type-library-access.md

File metadata and controls

75 lines (58 loc) · 2.14 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Type Library Access | Microsoft Docs
11/04/2016
cpp-windows
article
vc.mfc.macros
C++
type libraries [MFC], accessing
a03fa7f0-86c2-4119-bf81-202916fb74b3
14
mikeblome
mblome
ghogen

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.

Requirements

Header: afxdisp.h

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.

Requirements

Header: afxdisp.h

See Also

Macros and Globals