PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CppOfficeManagedCOMAddInShim/ConnectProxy.h

#
C++ Header | 55 lines | 39 code | 13 blank | 3 comment | 0 complexity | c4b4940408bbac8b78c6a4318b55a258 MD5 | raw file
 1// ConnectProxy.h
 2#pragma once
 3#include "resource.h"
 4#include "CppOfficeManagedCOMAddInShim.h"
 5
 6using namespace AddInDesignerObjects;
 7
 8class ATL_NO_VTABLE CConnectProxy : 
 9    public CComObjectRootEx<CComSingleThreadModel>,
10    public CComCoClass<CConnectProxy, &CLSID_ConnectProxy>,
11    public IDispatchImpl<_IDTExtensibility2, 
12        &IID__IDTExtensibility2, 
13        &LIBID_AddInDesignerObjects, 1, 0>,
14    public IComAggregator
15{
16public:
17    CConnectProxy();
18
19    DECLARE_REGISTRY_RESOURCEID(IDR_CONNECTPROXY)
20    DECLARE_PROTECT_FINAL_CONSTRUCT()
21
22    BEGIN_COM_MAP(CConnectProxy)
23        COM_INTERFACE_ENTRY(IDTExtensibility2)
24        COM_INTERFACE_ENTRY(IComAggregator)
25        COM_INTERFACE_ENTRY_AGGREGATE_BLIND(m_pUnknownInner)
26    END_COM_MAP()
27
28    HRESULT FinalConstruct();
29    void FinalRelease();
30
31public:
32    //IDTExtensibility2.
33    STDMETHOD(OnConnection)(
34        IDispatch * Application, ext_ConnectMode ConnectMode, 
35        IDispatch *AddInInst, SAFEARRAY **custom);
36
37    STDMETHOD(OnAddInsUpdate)(SAFEARRAY **custom);
38
39    STDMETHOD(OnStartupComplete)(SAFEARRAY **custom);
40
41    STDMETHOD(OnBeginShutdown)(SAFEARRAY **custom);
42
43    STDMETHOD(OnDisconnection)(
44        ext_DisconnectMode RemoveMode, SAFEARRAY **custom);
45
46    // IComAggregator.
47    STDMETHOD(SetInnerPointer)(IUnknown* pUnkInner);
48
49private:
50    IDTExtensibility2 *m_pConnect;
51    CCLRLoader *m_pCLRLoader;
52    IUnknown *m_pUnknownInner;
53};
54
55OBJECT_ENTRY_AUTO(__uuidof(ConnectProxy), CConnectProxy)