soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SAxUtil.h
1/*
2** Copyright 2008-2009, Ernest Laurentin (http://www.ernzo.com/)
3**
4** Licensed under the Apache License, Version 2.0 (the "License");
5** you may not use this file except in compliance with the License.
6** You may obtain a copy of the License at
7**
8** http://www.apache.org/licenses/LICENSE-2.0
9**
10** Unless required by applicable law or agreed to in writing, software
11** distributed under the License is distributed on an "AS IS" BASIS,
12** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13** See the License for the specific language governing permissions and
14** limitations under the License.
15**
16** File: AtlAxUtil.cpp
17** Version: 1.0
18*/
19#ifndef ATLAXUTIL_HPP
20#define ATLAXUTIL_HPP
21
22/**
23 * NoRefIUnknownImpl class
24 */
25template <class Base> class NoRefIUnknownImpl : public Base
26{
27 public:
29 Base::FinalRelease();
30 }
31
32 // IUnknown
33 virtual ULONG STDMETHODCALLTYPE AddRef() { return 1; }
34 virtual ULONG STDMETHODCALLTYPE Release() { return 0; }
35};
36
37/**
38 * MinimumIDispatchImpl
39 */
40class MinimumIDispatchImpl : public IDispatch {
41 public:
42 STDMETHOD(GetTypeInfoCount)(UINT *pctinfo)
43 {
44 *pctinfo = 0;
45 return S_OK;
46 }
47 STDMETHOD(GetTypeInfo)(UINT /*iTInfo*/, LCID /*lcid*/, ITypeInfo** /*ppTInfo*/)
48 {
49 return E_NOTIMPL;
50 }
51 STDMETHOD(GetIDsOfNames)(REFIID /*riid*/, LPOLESTR* /*rgszNames*/,
52 UINT /*cNames*/, LCID /*lcid*/, DISPID* /*rgDispId*/)
53 {
54 return E_NOTIMPL;
55 }
56 STDMETHOD(Invoke)(DISPID /*dispIdMember*/, REFIID /*riid*/, LCID /*lcid*/, WORD /*wFlags*/,
57 DISPPARAMS* /*pDispParams*/, VARIANT* /*pVarResult*/, EXCEPINFO* /*pExcepInfo*/,
58 UINT* /*puArgErr*/)
59 {
60 // check 'OleCtl.h' for list of DISPID_*
61 return E_NOTIMPL;
62 }
63};
64
65#endif //ATLAXUTIL_HPP