00001
00002
00003
00004
00005
00006
00007
00008 #pragma once
00009
00010 #include "..\foundation\arrays.h"
00011 #include "..\foundation\functions.h"
00012 #include "OLE.classids.h"
00013
00014
00015
00016 #define MS_E_EXCEPTION MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x0200)
00017 #define MS_E_ILLEGAL_RETURN_VALUE MS_E_EXCEPTION + 0x001
00018
00019
00020
00021 class MSClassFactory : public IClassFactory
00022 {
00023 public:
00024 static IClassFactory* Create();
00025
00026
00027 STDMETHOD(QueryInterface)(REFIID iid, void** ppv);
00028 STDMETHOD_(unsigned long, AddRef)(void);
00029 STDMETHOD_(unsigned long, Release)(void);
00030
00031
00032 STDMETHOD(CreateInstance)(IUnknown* pUnkOuter, REFIID iid, void** ppv);
00033 STDMETHOD(LockServer)(BOOL fLock);
00034
00035 private:
00036 MSClassFactory();
00037
00038 unsigned long m_refs;
00039 };
00040
00041
00042
00043 class MSOLEObject : public IDispatch
00044 {
00045 public:
00046 static MSOLEObject* Create();
00047
00048
00049 STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj);
00050 STDMETHOD_(unsigned long, AddRef)(void);
00051 STDMETHOD_(unsigned long, Release)(void);
00052
00053
00054 STDMETHOD(GetTypeInfoCount)(unsigned int* pcTypeInfo);
00055 STDMETHOD(GetTypeInfo)(unsigned int iTypeInfo, LCID lcid, ITypeInfo** ppTypeInfo);
00056 STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR** rgszNames, unsigned int cNames, LCID lcid, DISPID* rgdispid);
00057 STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid, unsigned short wFlags,
00058 DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, unsigned int* puArgErr);
00059
00060
00061
00062 unsigned long m_refs;
00063 static Array* exposed_fns;
00064
00065 MSOLEObject();
00066
00067 static void install_fns(Array* fns);
00068 };
00069
00070
00071
00072 visible_class (OLEObject)
00073
00074 class OLEObject : public Value
00075 {
00076 public:
00077 Value* progID;
00078 CLSID clsid;
00079 LPDISPATCH pdisp;
00080
00081 OLEObject(Value* progID, CLSID cslid, LPDISPATCH pdisp);
00082 OLEObject(Value* progID, LPDISPATCH pdisp);
00083 ~OLEObject();
00084 #define is_OLEObject(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(OLEObject))
00085
00086 classof_methods (OLEObject, Value);
00087 void collect() { delete this; }
00088 void gc_trace();
00089 ScripterExport void sprin1(CharStream* s);
00090
00091 Value* get_property(Value** arg_list, int count);
00092 Value* set_property(Value** arg_list, int count);
00093 Value* get_fn_property(Value* prop);
00094 };
00095
00096 visible_class (OLEMethod)
00097
00098 class OLEMethod : public Function
00099 {
00100 public:
00101 OLEObject* ole_obj;
00102 DISPID dispid;
00103
00104 OLEMethod() { }
00105 OLEMethod(MCHAR* name, OLEObject* ole_obj, DISPID mth_id);
00106 #define is_OLEMethod(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(OLEMethod))
00107
00108 classof_methods (OLEMethod, Function);
00109 void collect() { delete this; }
00110 void gc_trace();
00111
00112 Value* apply(Value** arglist, int count, CallContext* cc=NULL);
00113 };
00114
00115
00116 applyable_class_debug_ok (SafeArrayWrapper)
00117
00118
00119 class SafeArrayWrapper : public Value
00120 {
00121 friend SafeArrayWrapperClass;
00122 public:
00123 Value* dataArray;
00124 Value* lBoundsArray;
00125 int numDims;
00126
00127
00128 ScripterExport SafeArrayWrapper();
00129
00130
00131
00132
00133 ScripterExport SafeArrayWrapper(Array* dataArray, int nDims);
00134
00135
00136
00137
00138
00139
00140 ScripterExport SafeArrayWrapper(Array* dataArray, Array* lBoundsArray, int nDims);
00141
00142
00143
00144
00145 ScripterExport SafeArrayWrapper(SAFEARRAY *psa, Value* progID);
00146
00147
00148
00149
00150
00151 ScripterExport SAFEARRAY* to_SAFEARRAY();
00152
00153
00154
00155
00156
00157 ScripterExport static int GetDataArrayDimensions(Array* testArray);
00158
00159
00160
00161
00162
00163
00164
00165
00166 ScripterExport static void CheckDataArray(Array* testArray, int nDims, int* pCount = NULL);
00167
00168 #define is_SafeArrayWrapper(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(SafeArrayWrapper))
00169
00170 classof_methods (SafeArrayWrapper, Value);
00171 void collect() { delete this; }
00172 void gc_trace();
00173 ScripterExport void sprin1(CharStream* s);
00174
00175
00176
00177 #include "..\macros\define_implementations.h"
00178 use_generic( copy, "copy");
00179
00180 Value* get_property(Value** arg_list, int count);
00181 Value* set_property(Value** arg_list, int count);
00182
00183 };
00184
00185
00186 BOOL init_MAXScript_OLE();
00187 void uninit_OLE();
00188
00189 #define UNUSED(X) (X)
00190