MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SafeArrayInvoke

Method SafeArrayInvoke

source/script_com.cpp:1357–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355
1356
1357ResultType ComObject::SafeArrayInvoke(ResultToken &aResultToken, int aID, int aFlags, ExprTokenType *aParam[], int aParamCount)
1358{
1359 HRESULT hr = E_UNEXPECTED;
1360 SAFEARRAY *psa = (SAFEARRAY*)mVal64;
1361
1362 LONG retval;
1363 switch (aID)
1364 {
1365 case M___Enum:
1366 ComArrayEnum *enm;
1367 if (SUCCEEDED(hr = ComArrayEnum::Begin(this, enm, ParamIndexToOptionalInt(0, 2))))
1368 aResultToken.SetValue(enm);
1369 break;
1370 case M_Clone:
1371 SAFEARRAY *clone;
1372 if (SUCCEEDED(hr = SafeArrayCopy(psa, &clone)))
1373 if (!SafeSetTokenObject(aResultToken, new ComObject((__int64)clone, mVarType, F_OWNVALUE)))
1374 SafeArrayDestroy(clone);
1375 break;
1376 case M_MaxIndex:
1377 hr = SafeArrayGetUBound(psa, (UINT)ParamIndexToOptionalInt64(0, 1), &retval);
1378 if (SUCCEEDED(hr))
1379 aResultToken.SetValue(retval);
1380 break;
1381 case M_MinIndex:
1382 hr = SafeArrayGetLBound(psa, (UINT)ParamIndexToOptionalInt64(0, 1), &retval);
1383 if (SUCCEEDED(hr))
1384 aResultToken.SetValue(retval);
1385 break;
1386 }
1387 if (FAILED(hr))
1388 ComError(hr, aResultToken);
1389 return aResultToken.Result();
1390}
1391
1392
1393ResultType ComObject::SafeArrayItem(ResultToken &aResultToken, int aID, int aFlags, ExprTokenType *aParam[], int aParamCount)

Callers

nothing calls this directly

Calls 4

SafeSetTokenObjectFunction · 0.85
ComErrorFunction · 0.85
SetValueMethod · 0.80
ResultMethod · 0.80

Tested by

no test coverage detected