Visual Studio 2010 - Visual C++
AfxOleRegisterTypeLib
Registers the type library with the Windows registration database and allows the type library to be used by other containers that are OLE-control aware.
BOOL AfxOleRegisterTypeLib( HINSTANCE hInstance, REFGUID tlid, LPCTSTR pszFileName = NULL, LPCTSTR pszHelpDir = NULL );
Parameters
Return Value
Nonzero if the type library was registered; otherwise 0.
Remarks
This function updates the registry with the type library name and its location on the system.
Example
Visual C++
// Type library guid definition. const GUID CDECL BASED_CODE _tlid = { 0x77E58ED8, 0xA2C0, 0x4C13, { 0xB6, 0xC1, 0xBA, 0xD1, 0x19, 0xAF, 0xE3, 0xF1 } };
Visual C++
// Registers type library and the interfaces // in it, afxctl.h needs to be included if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid)) return ResultFromScode(SELFREG_E_TYPELIB); // CMFCAutomation.tlb should be in the same directory as exe module. // last param can be null if help file associated w/ tlb is in same dir as .tlb if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid, _T("CMFCAutomation.tlb"), NULL)) { return ResultFromScode(SELFREG_E_TYPELIB); }
Requirements
Header: afxdisp.h
See Also