/// <exception cref="VariantException"></exception> /// <exception cref="TjsException"></exception> protected internal override int Process(Variant result, Variant[] param, Dispatch2 objthis) { Variant val = new Variant(string.Empty); if ((param.Length > 0) ? param[0].IsVoid() != true : false) { val.CopyRef(param[0]); } string message_name = "message"; objthis.PropSet(Interface.MEMBERENSURE, message_name, val, objthis); if ((param.Length > 1) ? param[1].IsVoid() != true : false) { val.CopyRef(param[1]); } else { val.Set(string.Empty); } string trace_name = "trace"; objthis.PropSet(Interface.MEMBERENSURE, trace_name, val, objthis); return(Error.S_OK); }
// operation with member /// <exception cref="VariantException"></exception> /// <exception cref="TjsException"></exception> public virtual int Operation(int flag, string memberName, Variant result, Variant param, Dispatch2 objThis) { int op = flag & OP_MASK; if (op != OP_INC && op != OP_DEC && param == null) { return(Error.E_INVALIDPARAM); } if (op < OP_MIN || op > OP_MAX) { return(Error.E_INVALIDPARAM); } Variant tmp = new Variant(); int hr = PropGet(0, memberName, tmp, objThis); if (hr < 0) { return(hr); } // #define TJS_FAILED(x) ((x)<0) DoVariantOperation(op, tmp, param); hr = PropSet(0, memberName, tmp, objThis); if (hr < 0) { return(hr); } if (result != null) { result.CopyRef(tmp); } return(Error.S_OK); }
public void SetValue(Variant val) { if (mVal == null) { mVal = new Variant(val); } else { mVal.CopyRef(val); } }