1
// nsXPCDispTestProperties.cpp : Implementation of CXPCIDispatchTestApp and DLL registration.
4
#include "XPCIDispatchTest.h"
5
#include "nsXPCDispTestProperties.h"
7
const long PARAMETERIZED_PROPERTY_COUNT = 5;
8
/////////////////////////////////////////////////////////////////////////////
11
STDMETHODIMP nsXPCDispTestProperties::InterfaceSupportsErrorInfo(REFIID riid)
13
static const IID* arr[] =
15
&IID_nsIXPCDispTestProperties,
18
for (int i=0;i<sizeof(arr)/sizeof(arr[0]);i++)
20
if (InlineIsEqualGUID(*arr[i],riid))
26
nsXPCDispTestProperties::nsXPCDispTestProperties() :
35
mParameterizedProperty(new long[PARAMETERIZED_PROPERTY_COUNT])
38
CComBSTR string("Initial value");
39
mBSTR = string.Detach();
40
for (long index = 0; index < PARAMETERIZED_PROPERTY_COUNT; ++index)
41
mParameterizedProperty[index] = index + 1;
44
nsXPCDispTestProperties::~nsXPCDispTestProperties()
46
delete [] mParameterizedProperty;
49
STDMETHODIMP nsXPCDispTestProperties::get_Short(short *pVal)
56
STDMETHODIMP nsXPCDispTestProperties::put_Short(short newVal)
63
STDMETHODIMP nsXPCDispTestProperties::get_Long(long *pVal)
70
STDMETHODIMP nsXPCDispTestProperties::put_Long(long newVal)
77
STDMETHODIMP nsXPCDispTestProperties::get_Float(float *pVal)
84
STDMETHODIMP nsXPCDispTestProperties::put_Float(float newVal)
91
STDMETHODIMP nsXPCDispTestProperties::get_Double(double *pVal)
98
STDMETHODIMP nsXPCDispTestProperties::put_Double(double newVal)
105
STDMETHODIMP nsXPCDispTestProperties::get_Currency(CURRENCY *pVal)
112
STDMETHODIMP nsXPCDispTestProperties::put_Currency(CURRENCY newVal)
119
STDMETHODIMP nsXPCDispTestProperties::get_Date(DATE *pVal)
126
STDMETHODIMP nsXPCDispTestProperties::put_Date(DATE newVal)
133
STDMETHODIMP nsXPCDispTestProperties::get_String(BSTR *pVal)
135
*pVal = mBSTR.Copy();
140
STDMETHODIMP nsXPCDispTestProperties::put_String(BSTR newVal)
147
STDMETHODIMP nsXPCDispTestProperties::get_DispatchPtr(IDispatch **pVal)
149
mIDispatch.CopyTo(pVal);
154
STDMETHODIMP nsXPCDispTestProperties::put_DispatchPtr(IDispatch *newVal)
161
STDMETHODIMP nsXPCDispTestProperties::get_SCode(SCODE *pVal)
168
STDMETHODIMP nsXPCDispTestProperties::put_SCode(SCODE newVal)
175
STDMETHODIMP nsXPCDispTestProperties::get_Boolean(BOOL *pVal)
182
STDMETHODIMP nsXPCDispTestProperties::put_Boolean(BOOL newVal)
189
STDMETHODIMP nsXPCDispTestProperties::get_Variant(VARIANT *pVal)
191
::VariantCopy(pVal, &mVariant);
196
STDMETHODIMP nsXPCDispTestProperties::put_Variant(VARIANT newVal)
203
STDMETHODIMP nsXPCDispTestProperties::get_COMPtr(IUnknown **pVal)
205
mIUnknown.CopyTo(pVal);
210
STDMETHODIMP nsXPCDispTestProperties::put_COMPtr(IUnknown *newVal)
217
STDMETHODIMP nsXPCDispTestProperties::get_Char(unsigned char *pVal)
224
STDMETHODIMP nsXPCDispTestProperties::put_Char(unsigned char newVal)
231
STDMETHODIMP nsXPCDispTestProperties::get_ParameterizedProperty(long aIndex, long *pVal)
233
if (aIndex < 0 || aIndex >= PARAMETERIZED_PROPERTY_COUNT)
236
*pVal = mParameterizedProperty[aIndex];
241
STDMETHODIMP nsXPCDispTestProperties::put_ParameterizedProperty(long aIndex, long newVal)
243
if (aIndex < 0 || aIndex >= PARAMETERIZED_PROPERTY_COUNT)
246
mParameterizedProperty[aIndex] = newVal;
251
STDMETHODIMP nsXPCDispTestProperties::get_ParameterizedPropertyCount(long *pVal)
253
*pVal = PARAMETERIZED_PROPERTY_COUNT;