CFx SDK Documentation  2023 SP0
Registrar.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 // Registrar.h: interface for the OdAxTypeLibRegistrar class.
26 //
28 
29 #if !defined(AFX_REGISTRAR_H__233580DF_A612_4625_A3AA_2336FCE65460__INCLUDED_)
30 #define AFX_REGISTRAR_H__233580DF_A612_4625_A3AA_2336FCE65460__INCLUDED_
31 
32 #if _MSC_VER > 1000
33 #pragma once
34 #endif // _MSC_VER > 1000
35 
36 #include "TD_PackPush.h"
37 
38 #include <atlbase.h>
39 #include <comdef.h>
40 #include "OdString.h"
41 #include "RegExport.h"
42 
46 {
47  ITypeLibPtr m_pLib;
48  TLIBATTR m_tlbAttr;
49  OdString m_sDLLPath;
50  OdString m_sEXEPath;
51  OdString m_sTlbGUID;
52  OdString m_sNameSpace;
53  OdString m_sCurVer;
54  OdString m_sCurVerHex;
55  OdString m_sCurVerUpdate; // To update Version-Independent ProgID values
56  int m_nToolBoxBitmap;
57  DWORD m_nMiscStatus;
58 
59  UINT openTypeLib(const OdString& sDLLPath);
60 
61  void regTypeLib();
62  void unregTypeLib();
63  void registerType(ITypeInfo2* pType);
64  void registerCoClass(ITypeInfo2* pType);
65  void unregisterType(ITypeInfo2* pType, OdString ver);
66  void unregisterCoClass(ITypeInfo2* pType, OdString ver);
67  void registerVersionIndependentProgid(
68  LPCTSTR vi_progid, LPCTSTR name, LPCTSTR guid, LPCTSTR progid ) const;
69  bool isVersionHigher( int major, int minor ) const;
70  // determine the youngest tlb left (for CurVer replacement)
71  OdString getMaxVersionLeft();
72  int majorVer() const { return m_tlbAttr.wMajorVerNum; }
73  int minorVer() const { return m_tlbAttr.wMinorVerNum; }
74  const OdString& decimalVerStr() const { return m_sCurVer; }
75  const OdString& hexVerStr() const { return m_sCurVerHex; }
76 public:
79 
80  void regTypeLib(const OdString& sDLLPath, int toolBoxBitmap = 1, DWORD nMiscStatus = OLEMISC_RECOMPOSEONRESIZE,
81  const OdString& sEXEPath = OdString::kEmpty);
82 
83  void unregTypeLib(const OdString& sDLLPath);
84 };
85 extern "C"
86 {
87  TDREG_API HRESULT odAxRegisterTypeLib(const OdString& sPath, int toolBoxBitmap = 1, DWORD nMiscStatus = OLEMISC_RECOMPOSEONRESIZE );
88  TDREG_API HRESULT odAxUnregisterTypeLib(const OdString& sPath);
89 };
90 
91 #include "TD_PackPop.h"
92 
93 #endif // !defined(AFX_REGISTRAR_H__233580DF_A612_4625_A3AA_2336FCE65460__INCLUDED_)
#define TDREG_API
Definition: RegExport.h:39
TDREG_API HRESULT odAxRegisterTypeLib(const OdString &sPath, int toolBoxBitmap=1, DWORD nMiscStatus=OLEMISC_RECOMPOSEONRESIZE)
TDREG_API HRESULT odAxUnregisterTypeLib(const OdString &sPath)
void regTypeLib(const OdString &sDLLPath, int toolBoxBitmap=1, DWORD nMiscStatus=OLEMISC_RECOMPOSEONRESIZE, const OdString &sEXEPath=OdString::kEmpty)
virtual ~OdAxTypeLibRegistrar()
void unregTypeLib(const OdString &sDLLPath)
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition: OdString.h:98
GLuint const GLchar * name
Definition: gles2_ext.h:265