ICP  1
api.h
Go to the documentation of this file.
1 // api.h : Declaration of the Capi
2 
3 #pragma once
4 #include "resource.h" // main symbols
5 
6 
7 
8 #include "instapi_i.h"
9 #include "_IapiEvents_CP.h"
10 
11 
12 
13 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
14 #error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
15 #endif
16 
17 using namespace ATL;
18 
19 
20 // Capi
21 
22 class ATL_NO_VTABLE Capi :
23  public CComObjectRootEx<CComMultiThreadModel>,
24  public CComCoClass<Capi, &CLSID_api>,
25  public ISupportErrorInfo,
26  public IConnectionPointContainerImpl<Capi>,
27  public CProxy_IapiEvents<Capi>,
28  public IDispatchImpl<Iapi, &IID_Iapi, &LIBID_instapiLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
29 {
30 public:
31  Capi()
32  {
33  }
34 
35 DECLARE_REGISTRY_RESOURCEID(IDR_API)
36 
37 
38 BEGIN_COM_MAP(Capi)
39  COM_INTERFACE_ENTRY(Iapi)
40  COM_INTERFACE_ENTRY(IDispatch)
41  COM_INTERFACE_ENTRY(ISupportErrorInfo)
42  COM_INTERFACE_ENTRY(IConnectionPointContainer)
43 END_COM_MAP()
44 
45 BEGIN_CONNECTION_POINT_MAP(Capi)
46  CONNECTION_POINT_ENTRY(__uuidof(_IapiEvents))
47 END_CONNECTION_POINT_MAP()
48 // ISupportsErrorInfo
49  STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
50 
51 
52  DECLARE_PROTECT_FINAL_CONSTRUCT()
53 
54  HRESULT FinalConstruct()
55  {
56  return S_OK;
57  }
58 
59  void FinalRelease()
60  {
61  }
62 
63 public:
64 
65 
66  STDMETHOD(create)(BSTR instrument, BSTR user_name, BSTR password, Isession** session);
67 };
68 
69 OBJECT_ENTRY_AUTO(__uuidof(api), Capi)
void FinalRelease()
Definition: api.h:59
Capi()
Definition: api.h:31
Definition: api.h:22
#define IDR_API
Definition: resource.h:7