Update of /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16048/com/TestSources/PyCOMTest
Modified Files:
Tag: py3k
PyCOMImpl.cpp PyCOMImpl.h PyCOMTest.idl
Log Message:
Explicit tests for VT_UI1 safe arrays being passed buffers and integers
Index: PyCOMTest.idl
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMTest.idl,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -C2 -d -r1.19 -r1.19.2.1
*** PyCOMTest.idl 1 Jul 2008 00:07:58 -0000 1.19
--- PyCOMTest.idl 9 Jan 2009 01:26:19 -0000 1.19.2.1
***************
*** 205,208 ****
--- 205,209 ----
// Test Safe arrays - simple, then alias, enum
+ HRESULT SetBinSafeArray([in] SAFEARRAY(unsigned char) buf, [out, retval]int *resultSize);
HRESULT SetIntSafeArray([in] SAFEARRAY(int) ints, [out, retval]int *resultSize);
HRESULT SetVariantSafeArray([in] SAFEARRAY(VARIANT) vars, [out, retval]int *resultSize);
Index: PyCOMImpl.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMImpl.h,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -C2 -d -r1.16 -r1.16.2.1
*** PyCOMImpl.h 8 Apr 2008 11:51:26 -0000 1.16
--- PyCOMImpl.h 9 Jan 2009 01:26:19 -0000 1.16.2.1
***************
*** 71,74 ****
--- 71,75 ----
STDMETHOD(TakeByRefTypedDispatch)(IPyCOMTest **inout);
STDMETHOD(TakeByRefDispatch)(IDispatch **inout);
+ STDMETHOD(SetBinSafeArray)(SAFEARRAY* buf, int *retSize);
STDMETHOD(SetIntSafeArray)(SAFEARRAY* ints, int *retSize);
STDMETHOD(SetVariantSafeArray)(SAFEARRAY* vars, int *retSize);
Index: PyCOMImpl.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMImpl.cpp,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -d -r1.18 -r1.18.2.1
*** PyCOMImpl.cpp 8 Apr 2008 11:51:26 -0000 1.18
--- PyCOMImpl.cpp 9 Jan 2009 01:26:19 -0000 1.18.2.1
***************
*** 235,238 ****
--- 235,254 ----
}
+ STDMETHODIMP CPyCOMTest::SetBinSafeArray(SAFEARRAY* buf, int *resultSize)
+ {
+ UINT cDims = SafeArrayGetDim(buf);
+ *resultSize = 0;
+ long ub=0, lb=0;
+ if (cDims) {
+ SafeArrayGetUBound(buf, 1, &ub);
+ SafeArrayGetLBound(buf, 1, &lb);
+ *resultSize = ub - lb + 1;
+ }
+ TCHAR dbgbuf[256];
+ wsprintf(dbgbuf, _T("Have binary SafeArray with %d dims and size %d\n"), cDims, *resultSize);
+ OutputDebugString(dbgbuf);
+ return S_OK;
+ }
+
STDMETHODIMP CPyCOMTest::SetIntSafeArray(SAFEARRAY* ints, int *resultSize)
{
|