Beispiel #1
0
        static int Invoke(IDispatch dispatch, int memberDispId, out object result)
        {
            Guid emtpyRiid = Guid.Empty;

            ComTypes.DISPPARAMS dispParams = new ComTypes.DISPPARAMS();
            ComTypes.EXCEPINFO  excepInfo  = new ComTypes.EXCEPINFO();
            uint argErr;
            int  hresult = dispatch.TryInvoke(
                memberDispId,
                ref emtpyRiid,
                0,
                ComTypes.INVOKEKIND.INVOKE_PROPERTYGET,
                ref dispParams,
                out result,
                out excepInfo,
                out argErr);

            return(hresult);
        }
Beispiel #2
0
        private static unsafe int Invoke(IDispatch dispatch, int memberDispId, out object result)
        {
            Guid emtpyRiid = Guid.Empty;

            ComTypes.DISPPARAMS dispParams = new ComTypes.DISPPARAMS();
            Variant             res        = default;
            int hresult = dispatch.TryInvoke(
                memberDispId,
                ref emtpyRiid,
                0,
                ComTypes.INVOKEKIND.INVOKE_PROPERTYGET,
                ref dispParams,
                (IntPtr)(&res),
                IntPtr.Zero,
                IntPtr.Zero);

            result = res.ToObject();

            return(hresult);
        }
Beispiel #3
0
        static int Invoke(IDispatch dispatch, int memberDispId, out object result) {
            Guid emtpyRiid = Guid.Empty;
            ComTypes.DISPPARAMS dispParams = new ComTypes.DISPPARAMS();
            ComTypes.EXCEPINFO excepInfo = new ComTypes.EXCEPINFO();
            uint argErr;
            int hresult = dispatch.TryInvoke(
                memberDispId,
                ref emtpyRiid,
                0,
                ComTypes.INVOKEKIND.INVOKE_PROPERTYGET,
                ref dispParams,
                out result,
                out excepInfo,
                out argErr);

            return hresult;
        }