1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 // Callback.h : Declaration of the CCallback
24 
25 #ifndef __CALLBACK_H_
26 #define __CALLBACK_H_
27 
28 #include "resource.h"       // main symbols
29 
30 /////////////////////////////////////////////////////////////////////////////
31 // CCallback
32 class ATL_NO_VTABLE CCallback :
33 	public CComObjectRootEx<CComSingleThreadModel>,
34 	public CComCoClass<CCallback, &CLSID_Callback>,
35 	public IDispatchImpl<ICallback, &IID_ICallback, &LIBID_XCALLBACK_IMPLLib>
36 {
37 public:
CCallback()38 	CCallback()
39 	{
40 	}
41 
42 DECLARE_REGISTRY_RESOURCEID(IDR_CALLBACK)
43 
44 DECLARE_PROTECT_FINAL_CONSTRUCT()
45 
46 BEGIN_COM_MAP(CCallback)
47 	COM_INTERFACE_ENTRY(ICallback)
48 	COM_INTERFACE_ENTRY(IDispatch)
49 END_COM_MAP()
50 
51 // ICallback
52 public:
53 	STDMETHOD(inSeqByte)(/*[in]*/ LPSAFEARRAY val);
54 	STDMETHOD(inSeqXEventListener)(/*[in]*/ LPSAFEARRAY listener, LPSAFEARRAY event);
55 	STDMETHOD(outSeqByte)(/*[out]*/ LPSAFEARRAY* outVal);
56 	STDMETHOD(inValues)(/*[in]*/short aChar, /*[in]*/ long aLong, /*[in]*/ BSTR aString);
57 	STDMETHOD(inoutLong)(/*[in,out]*/ long* inoutVal);
58 	STDMETHOD(inoutShort)(/*[in,out]*/ short* inoutVal);
59 	STDMETHOD(inoutByte)(/*[in,out]*/ unsigned char* inoutVal);
60 	STDMETHOD(inoutDouble)(/*[in,out]*/ double* inoutVal);
61 	STDMETHOD(inoutFloat)(/*[in,out]*/ float* inoutVal);
62 	STDMETHOD(inoutString)(/*[in,out]*/ BSTR *inoutVal);
63 	STDMETHOD(inoutChar)(/*[in,out]*/ short* inoutVal);
64 	STDMETHOD(inoutBool)(/*[in,out]*/ VARIANT_BOOL * inoutVal);
65 	STDMETHOD(inoutAny)(/*[in,out]*/ VARIANT* inoutVal);
66 	STDMETHOD(inoutSeqAny)(/*[in,out]*/ LPSAFEARRAY* pArray);
67 	STDMETHOD(inoutEnum)(/*[in,out]*/ long * inoutVal);
68 	STDMETHOD(inoutStruct)(/*[in,out]*/ IDispatch** inoutVal);
69 	STDMETHOD(inoutInterface)(/*[in,out]*/ IDispatch** ppdisp);
70 	STDMETHOD(inoutValuesAll)(
71             /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aXSimple,
72             /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aStruct,
73             /* [out][in] */ long __RPC_FAR *aEnum,
74             /* [out][in] */ SAFEARRAY __RPC_FAR * __RPC_FAR *aSeq,
75             /* [out][in] */ VARIANT __RPC_FAR *aAny,
76             /* [out][in] */ VARIANT_BOOL __RPC_FAR *aBool,
77             /* [out][in] */ short __RPC_FAR *aChar,
78             /* [out][in] */ BSTR __RPC_FAR *aString,
79             /* [out][in] */ float __RPC_FAR *aFloat,
80             /* [out][in] */ double __RPC_FAR *aDouble,
81             /* [out][in] */ unsigned char __RPC_FAR *aByte,
82             /* [out][in] */ short __RPC_FAR *aShort,
83             /* [out][in] */ long __RPC_FAR *aLong);
84 
85 	STDMETHOD(outByte)( unsigned char* outByte);
86 	STDMETHOD(outLong)(/*[out]*/ long* outLong);
87 	STDMETHOD(outShort)(/*[out]*/ short *outShort);
88 	STDMETHOD(outDouble)(/*[out]*/ double* outDouble);
89 	STDMETHOD(outFloat)(/*[out]*/ float* outFloat);
90 	STDMETHOD(outString)(/*[out]*/ BSTR * outString);
91 	STDMETHOD(outChar)(short* outChar);
92 	STDMETHOD(outBool)(VARIANT_BOOL* outBool);
93 	STDMETHOD(outAny)(VARIANT* outAny);
94 	STDMETHOD(outSeqAny)(/*[out]*/LPSAFEARRAY* outSeq);
95 	STDMETHOD(outEnum)(/*[out]*/ long* outEnum);
96 	STDMETHOD(outStruct)(/*[out]*/ IDispatch** outStruct);
97 	        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE outValuesAll(
98             /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp,
99             /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppSimpleStruct,
100             /* [out] */ long __RPC_FAR *aSimpleEnum,
101             /* [out] */ LPSAFEARRAY* outSeq,
102             /* [out] */ VARIANT __RPC_FAR *varAny,
103             /* [out] */ VARIANT_BOOL __RPC_FAR *aBool,
104             /* [out] */ short __RPC_FAR *aChar,
105             /* [out] */ BSTR __RPC_FAR *aString,
106             /* [out] */ float __RPC_FAR *aFloat,
107             /* [out] */ double __RPC_FAR *aDouble,
108             /* [out] */ unsigned char __RPC_FAR *aByte,
109             /* [out] */ short __RPC_FAR *aShort,
110             /* [out] */ long __RPC_FAR *aLong);
111 //				);
112 //
113 //	STDMETHOD(outValuesAll)(
114 //			/*[out]*/ IDispatch** ppdisp,
115 //			/*[out]*/ IUnknown** ppSimpleStruct,
116 //			/*[out]*/ long* aSimpleEnum,
117 //			/*[out]*/ VARIANT* ArrayAny,
118 //			/*[out]*/ VARIANT* varAny,
119 //			/*[out]*/ VARIANT_BOOL * aBool,
120 //			/*[out]*/ unsigned short* aChar,
121 //			/*[out]*/ BSTR* aString, /*[out]*/ float* aFloat,
122 //			/*[out]*/ double* aDouble,
123 //			/*[out]*/ signed char* aByte, /*[out]*/ short* aShort, /*[out]*/long* aLong, /*[out]*/ unsigned short* aUShort, /*[out]*/ unsigned long* aULong);
124 	STDMETHOD(outValuesMixed)(/*[in]*/ long val, /*[out]*/ long* pval, /*[in]*/ BSTR string);
125 	STDMETHOD(outInterface)(/*[out]*/ IDispatch** ppdisp);
126 	STDMETHOD(returnInterface)(/*[out, retval]*/ IDispatch** ppdisp);
127 	STDMETHOD(func1)();
128 };
129 
130 #endif //__CALLBACK_H_
131 
132