Exemplo n.º 1
0
 virtual /* [local] */ HRESULT STDMETHODCALLTYPE AddErrorRecord(
     /* [in] */ ERRORINFO *pErrorInfo,
     /* [in] */ DWORD dwLookupID,
     /* [in] */ DISPPARAMS *pdispparams,
     /* [in] */ IUnknown *punkCustomError,
     /* [in] */ DWORD dwDynamicErrorID) = 0;
Exemplo n.º 2
0
 virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetErrorParameters(
     /* [in] */ ULONG ulRecordNum,
     /* [out] */ DISPPARAMS *pdispparams) = 0;
        unsafe void NativeMethods.IDispatch.Invoke(int dispid, ref Guid riid, int lcid, INVOKEKIND wFlags, ref DISPPARAMS pDispParams, IntPtr pvarResult, IntPtr pExcepInfo, IntPtr puArgErr)
        {
            ComEventsMethod comEventsMethod = this.FindMethod(dispid);

            if (comEventsMethod == null)
            {
                return;
            }
            object[] array  = new object[pDispParams.cArgs];
            int[]    array2 = new int[pDispParams.cArgs];
            bool[]   array3 = new bool[pDispParams.cArgs];
            Variant *ptr    = (Variant *)((void *)pDispParams.rgvarg);
            int *    ptr2   = (int *)((void *)pDispParams.rgdispidNamedArgs);
            int      i;
            int      num;

            for (i = 0; i < pDispParams.cNamedArgs; i++)
            {
                num = ptr2[i];
                Variant *variant = ComEventsSink.GetVariant(ptr + i);
                array[num]  = variant->ToObject();
                array3[num] = true;
                if (variant->IsByRef)
                {
                    array2[num] = i;
                }
                else
                {
                    array2[num] = -1;
                }
            }
            num = 0;
            while (i < pDispParams.cArgs)
            {
                while (array3[num])
                {
                    num++;
                }
                Variant *variant2 = ComEventsSink.GetVariant(ptr + (pDispParams.cArgs - 1 - i));
                array[num] = variant2->ToObject();
                if (variant2->IsByRef)
                {
                    array2[num] = pDispParams.cArgs - 1 - i;
                }
                else
                {
                    array2[num] = -1;
                }
                num++;
                i++;
            }
            object obj = comEventsMethod.Invoke(array);

            if (pvarResult != IntPtr.Zero)
            {
                Marshal.GetNativeVariantForObject(obj, pvarResult);
            }
            for (i = 0; i < pDispParams.cArgs; i++)
            {
                int num2 = array2[i];
                if (num2 != -1)
                {
                    ComEventsSink.GetVariant(ptr + num2)->CopyFromIndirect(array[i]);
                }
            }
        }