[API]
RtlMoveMemory

[INCLUDE]
CallFunction
UIntAddUInt

[CODE]
Public Function OLEInterface_CallFunction(ByVal ptrInterface As Long, ByVal MemberOffset As Long, ParamArray FunctionParams()) As Long
  Dim xLong1 As Long
  If Not ptrInterface = 0& Then
    ReDim CallFunction_tmpParam(UBound(FunctionParams()) + 2&)
    
    CallFunction_tmpParam(0&) = ptrInterface
    Call RtlMoveMemory(ByVal VarPtr(ptrInterface), ByVal ptrInterface, 4&)
    UIntAddUInt ptrInterface, MemberOffset
    Call RtlMoveMemory(ByVal VarPtr(ptrInterface), ByVal ptrInterface, 4&)
    For xLong1 = 0& To UBound(FunctionParams())
      CallFunction_tmpParam(xLong1 + 1&) = FunctionParams(xLong1)
      Next
    OLEInterface_CallFunction = CallFunction_Real(ptrInterface)
    End If
  End Function