Separatista
dispatch.h
1 /***************************************************************************
2  * Copyright (C) 2013 by Okkel Klaver *
3  * info@vanhetland.nl *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
21 #ifndef SEPARATISTA_DISPATCH_H
22 #define SEPARATISTA_DISPATCH_H
23 
24 #include <windows.h>
25 
26 #include "separatista/debug/debug.h"
27 #include "separatista/exception.h"
28 #include "unknown.h"
29 
30 template <class T>
32 {
33 public:
38 
39  template <class C> static HRESULT Create(REFCLSID rclid, void** pvvObject);
40 
41  // IUnknown methods
42  HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** pvvObject);
43 
44  // IDispatch methods
45  HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int FAR* pctInfo);
46  HRESULT STDMETHODCALLTYPE GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo FAR* FAR* ppTInfo);
47  HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames, unsigned int cNames, LCID lcid, DISPID FAR* rgDispId);
48  HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr);
49 protected:
50  virtual ~SepaControlDispatch();
51 
55  HRESULT SetErrorInfo(const Separatista::Exception &e) const;
56 
60  HRESULT SetErrorInfo(const wchar_t *pMessage) const;
61 
62 
63  ITypeLib* m_pTypeLib;
64  ITypeInfo* m_pTypeInfo;
65 };
66 
67 #endif // !defined SEPARATISTA_DISPATCH_H
Definition: exception.h:40
Definition: unknown.h:28
Definition: dispatch.h:31
HRESULT SetErrorInfo(const Separatista::Exception &e) const
Definition: dispatch.cpp:123