MCPcopy Create free account
hub / github.com/mhammond/pywin32 / MakeFillIntArray

Function MakeFillIntArray

com/TestSources/PyCOMTest/PyCOMImpl.cpp:357–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357static HRESULT MakeFillIntArray(SAFEARRAY **ppRes, int len, VARENUM vt)
358{
359 HRESULT hr = S_OK;
360 SAFEARRAY *psa;
361 SAFEARRAYBOUND rgsabound[1] = { len, 0 };
362 psa = SafeArrayCreate(vt, 1, rgsabound);
363 if (psa==NULL)
364 return E_OUTOFMEMORY;
365 long i;
366 for (i=0;i<len;i++) {
367 if (S_OK!=(hr=SafeArrayPutElement(psa, &i, &i))) {
368 SafeArrayDestroy(psa);
369 return hr;
370 }
371 }
372 *ppRes = psa;
373 return S_OK;
374 }
375
376STDMETHODIMP CPyCOMTest::GetSafeArrays(SAFEARRAY** attrs,
377 SAFEARRAY**attrs2,

Callers 3

GetSafeArraysMethod · 0.85
GetSimpleSafeArrayMethod · 0.85
TestMyInterfaceMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestMyInterfaceMethod · 0.68