Пример #1
0
 /// <exception cref="TjsException"></exception>
 /// <exception cref="VariantException"></exception>
 public virtual int PropGet(int flag, string mumberName, Variant result, Dispatch2
                            objThis)
 {
     if (mObject == null)
     {
         throw new TjsException(Error.NullAccess);
     }
     return(mObject.PropGet(flag, mumberName, result, mObjThis != null ? mObjThis : (objThis
                                                                                     != null ? objThis : mObject)));
 }
Пример #2
0
        /// <exception cref="VariantException"></exception>
        /// <exception cref="TjsException"></exception>
        public virtual int PropGet(int flag, string membername, Variant result, Dispatch2
                                   objthis)
        {
            Dispatch2 OBJ1 = ((objthis != null) ? (objthis) : (mDispatch1));
            int       hr   = mDispatch1.PropGet(flag, membername, result, OBJ1);

            if (hr == Error.E_MEMBERNOTFOUND && mDispatch1 != mDispatch2)
            {
                Dispatch2 OBJ2 = ((objthis != null) ? (objthis) : (mDispatch2));
                return(mDispatch2.PropGet(flag, membername, result, OBJ2));
            }
            return(hr);
        }
Пример #3
0
        /// <summary>TJSGetExceptionObject : retrieves TJS 'Exception' object</summary>
        /// <exception cref="TjsException">TJSException</exception>
        /// <exception cref="VariantException">VariantException</exception>
        /// <exception cref="VariantException"></exception>
        /// <exception cref="TjsException"></exception>
        public static void GetExceptionObject(Tjs tjs, Variant res, Variant msg, Variant
                                              trace)
        {
            if (res == null)
            {
                return;
            }
            // not prcess
            // retrieve class "Exception" from global
            Dispatch2 global = tjs.GetGlobal();
            Variant   val    = new Variant();
            int       hr     = global.PropGet(0, EXCEPTION_NAME, val, global);

            if (hr < 0)
            {
                throw new TjsException(ExceptionNotFound);
            }
            // create an Exception object
            Holder <Dispatch2> excpobj = new Holder <Dispatch2>(null);
            VariantClosure     clo     = val.AsObjectClosure();

            Variant[] pmsg = new Variant[1];
            pmsg[0] = msg;
            hr      = clo.CreateNew(0, null, excpobj, pmsg, clo.mObjThis);
            if (hr < 0)
            {
                throw new TjsException(ExceptionNotFound);
            }
            Dispatch2 disp = excpobj.mValue;

            if (trace != null)
            {
                string trace_name = "trace";
                disp.PropSet(Interface.MEMBERENSURE, trace_name, trace, disp);
            }
            res.Set(disp, disp);
            excpobj = null;
        }