Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }