2 * Copyright 2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "vbscript_defs.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
31 #define VB_E_CANNOT_CREATE_OBJ 0x800a01ad
33 /* Defined as extern in urlmon.idl, but not exported by uuid.lib */
34 const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY =
35 {0x10200490,0xfa38,0x11d0,{0xac,0x0e,0x00,0xa0,0xc9,0xf,0xff,0xc0}};
37 static IInternetHostSecurityManager *get_sec_mgr(script_ctx_t *ctx)
39 IInternetHostSecurityManager *secmgr;
49 hres = IActiveScriptSite_QueryInterface(ctx->site, &IID_IServiceProvider, (void**)&sp);
53 hres = IServiceProvider_QueryService(sp, &SID_SInternetHostSecurityManager, &IID_IInternetHostSecurityManager,
55 IServiceProvider_Release(sp);
59 return ctx->secmgr = secmgr;
62 static HRESULT return_bstr(VARIANT *res, const WCHAR *str)
69 ret = SysAllocString(str);
78 static HRESULT return_short(VARIANT *res, short val)
88 static HRESULT return_int(VARIANT *res, int val)
91 return return_short(res, val);
101 static inline HRESULT return_null(VARIANT *res)
108 static IUnknown *create_object(script_ctx_t *ctx, const WCHAR *progid)
110 IInternetHostSecurityManager *secmgr = NULL;
111 IObjectWithSite *obj_site;
112 struct CONFIRMSAFETY cs;
113 IClassFactoryEx *cfex;
122 hres = CLSIDFromProgID(progid, &guid);
126 TRACE("GUID %s\n", debugstr_guid(&guid));
128 if(ctx->safeopt & INTERFACE_USES_SECURITY_MANAGER) {
129 secmgr = get_sec_mgr(ctx);
134 hres = IInternetHostSecurityManager_ProcessUrlAction(secmgr, URLACTION_ACTIVEX_RUN,
135 (BYTE*)&policy, sizeof(policy), (BYTE*)&guid, sizeof(GUID), 0, 0);
136 if(FAILED(hres) || policy != URLPOLICY_ALLOW)
140 hres = CoGetClassObject(&guid, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER, NULL, &IID_IClassFactory, (void**)&cf);
144 hres = IClassFactory_QueryInterface(cf, &IID_IClassFactoryEx, (void**)&cfex);
145 if(SUCCEEDED(hres)) {
146 FIXME("Use IClassFactoryEx\n");
147 IClassFactoryEx_Release(cfex);
150 hres = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj);
158 hres = IInternetHostSecurityManager_QueryCustomPolicy(secmgr, &GUID_CUSTOM_CONFIRMOBJECTSAFETY,
159 &bpolicy, &policy_size, (BYTE*)&cs, sizeof(cs), 0);
160 if(SUCCEEDED(hres)) {
161 policy = policy_size >= sizeof(DWORD) ? *(DWORD*)bpolicy : URLPOLICY_DISALLOW;
162 CoTaskMemFree(bpolicy);
165 if(FAILED(hres) || policy != URLPOLICY_ALLOW) {
166 IUnknown_Release(obj);
171 hres = IUnknown_QueryInterface(obj, &IID_IObjectWithSite, (void**)&obj_site);
172 if(SUCCEEDED(hres)) {
175 ax_site = create_ax_site(ctx);
177 hres = IObjectWithSite_SetSite(obj_site, ax_site);
178 IUnknown_Release(ax_site);
180 IObjectWithSite_Release(obj_site);
181 if(!ax_site || FAILED(hres)) {
182 IUnknown_Release(obj);
190 static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
196 static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
202 static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
208 static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
214 static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
220 static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
226 static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
232 static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
238 static HRESULT Global_CStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
244 static inline WCHAR hex_char(unsigned n)
246 return n < 10 ? '0'+n : 'A'+n-10;
249 static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
254 TRACE("%s\n", debugstr_variant(arg));
271 FIXME("unsupported type %s\n", debugstr_variant(arg));
280 *ptr-- = hex_char(n & 0xf);
288 return return_bstr(res, ptr);
291 static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
297 static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
303 static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
309 static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
311 TRACE("(%s)\n", debugstr_variant(arg));
313 assert(args_cnt == 1);
317 V_BOOL(res) = V_VT(arg) == VT_EMPTY ? VARIANT_TRUE : VARIANT_FALSE;
322 static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
324 TRACE("(%s)\n", debugstr_variant(arg));
326 assert(args_cnt == 1);
330 V_BOOL(res) = V_VT(arg) == VT_NULL ? VARIANT_TRUE : VARIANT_FALSE;
335 static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
341 static HRESULT Global_IsArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
347 static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
349 TRACE("(%s)\n", debugstr_variant(arg));
351 assert(args_cnt == 1);
355 V_BOOL(res) = V_VT(arg) == VT_DISPATCH ? VARIANT_TRUE : VARIANT_FALSE;
360 static HRESULT Global_Ant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
366 static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
372 static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
378 static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
384 static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
390 static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
396 static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
402 static HRESULT Global_Randomize(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
408 static HRESULT Global_Rnd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
414 static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
420 static HRESULT Global_LBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
426 static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
432 static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
438 static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
444 static HRESULT Global_LenB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
450 static HRESULT Global_Left(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
456 static HRESULT Global_LeftB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
462 static HRESULT Global_Right(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
468 static HRESULT Global_RightB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
474 static HRESULT Global_Mid(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
480 static HRESULT Global_MidB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
486 static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
492 static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
498 static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
504 static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
510 static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
516 static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
522 static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
528 static HRESULT Global_String(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
534 static HRESULT Global_InStr(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res)
536 VARIANT *startv, *str1v, *str2v;
554 FIXME("unsupported compare argument %s\n", debugstr_variant(args));
561 /* FIXME: Move to helper */
562 switch(V_VT(startv)) {
564 start = V_I2(startv);
567 start = V_I4(startv);
570 FIXME("unsupported start %s\n", debugstr_variant(startv));
574 FIXME("start %d\n", start);
581 if(V_VT(str1v) == VT_NULL || V_VT(str2v) == VT_NULL)
582 return return_null(res);
584 if(V_VT(str1v) != VT_BSTR) {
585 FIXME("Unsupported str1 type %s\n", debugstr_variant(str1v));
588 str1 = V_BSTR(str1v);
590 if(V_VT(str2v) != VT_BSTR) {
591 FIXME("Unsupported str2 type %s\n", debugstr_variant(str2v));
594 str2 = V_BSTR(str2v);
596 if(start < SysStringLen(str1)) {
599 ptr = strstrW(str1+start, str2);
600 ret = ptr ? ptr-str1+1 : 0;
605 return return_int(res, ret);
608 static HRESULT Global_InStrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
614 static HRESULT Global_AscB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
620 static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
626 static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
632 static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
638 static HRESULT Global_AscW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
644 static HRESULT Global_ChrW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
650 static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
656 static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
662 static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
668 static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
674 static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
680 static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
686 static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
692 static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
698 static HRESULT Global_Month(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
704 static HRESULT Global_Weekday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
710 static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
716 static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
722 static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
728 static HRESULT Global_Second(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
734 static HRESULT Global_DateValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
740 static HRESULT Global_TimeValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
746 static HRESULT Global_DateSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
752 static HRESULT Global_TimeSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
758 static HRESULT Global_InputBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
764 static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
770 static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
775 TRACE("(%s)\n", debugstr_variant(arg));
777 if(V_VT(arg) != VT_BSTR) {
778 FIXME("non-bstr arg\n");
782 obj = create_object(This->desc->ctx, V_BSTR(arg));
784 return VB_E_CANNOT_CREATE_OBJ;
787 hres = IUnknown_QueryInterface(obj, &IID_IDispatch, (void**)&V_DISPATCH(res));
791 V_VT(res) = VT_DISPATCH;
794 IUnknown_Release(obj);
798 static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
804 static HRESULT Global_DateAdd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
810 static HRESULT Global_DateDiff(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
816 static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
822 static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
828 static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
834 static HRESULT Global_Erase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
840 static HRESULT Global_Filter(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
846 static HRESULT Global_Join(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
852 static HRESULT Global_Split(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
858 static HRESULT Global_Replace(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
864 static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
870 static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
876 static HRESULT Global_LoadPicture(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
882 static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
888 static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
894 static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
900 static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
906 static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
912 static HRESULT Global_FormatCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
918 static HRESULT Global_FormatPercent(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
924 static HRESULT Global_FormatDateTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
930 static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
936 static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
942 static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
948 static HRESULT Global_Escape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
954 static HRESULT Global_Unescape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
960 static HRESULT Global_Eval(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
966 static HRESULT Global_Execute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
972 static HRESULT Global_ExecuteGlobal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
978 static HRESULT Global_GetRef(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
984 static HRESULT Global_vbUseSystem(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
990 static HRESULT Global_vbUseSystemDayOfWeek(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
996 static HRESULT Global_vbSunday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
999 return return_short(res, 1);
1002 static HRESULT Global_vbMonday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1005 return return_short(res, 2);
1008 static HRESULT Global_vbTuesday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1011 return return_short(res, 3);
1014 static HRESULT Global_vbWednesday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1017 return return_short(res, 4);
1020 static HRESULT Global_vbThursday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1023 return return_short(res, 5);
1026 static HRESULT Global_vbFriday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1029 return return_short(res, 6);
1032 static HRESULT Global_vbSaturday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1035 return return_short(res, 7);
1038 static HRESULT Global_vbFirstJan1(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1044 static HRESULT Global_vbFirstFourDays(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1050 static HRESULT Global_vbFirstFullWeek(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1056 static HRESULT Global_vbOKOnly(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1062 static HRESULT Global_vbOKCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1068 static HRESULT Global_vbAbortRetryIgnore(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1074 static HRESULT Global_vbYesNoCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1080 static HRESULT Global_vbYesNo(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1086 static HRESULT Global_vbRetryCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1092 static HRESULT Global_vbCritical(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1098 static HRESULT Global_vbQuestion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1104 static HRESULT Global_vbExclamation(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1110 static HRESULT Global_vbInformation(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1116 static HRESULT Global_vbDefaultButton1(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1122 static HRESULT Global_vbDefaultButton2(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1128 static HRESULT Global_vbDefaultButton3(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1134 static HRESULT Global_vbDefaultButton4(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1140 static HRESULT Global_vbApplicationModal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1146 static HRESULT Global_vbSystemModal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1152 static HRESULT Global_vbOK(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1158 static HRESULT Global_vbCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1164 static HRESULT Global_vbAbort(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1170 static HRESULT Global_vbRetry(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1176 static HRESULT Global_vbIgnore(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1182 static HRESULT Global_vbYes(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1188 static HRESULT Global_vbNo(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1194 static HRESULT Global_vbEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1200 static HRESULT Global_vbNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1206 static HRESULT Global_vbInteger(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1212 static HRESULT Global_vbLong(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1218 static HRESULT Global_vbSingle(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1224 static HRESULT Global_vbDouble(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1230 static HRESULT Global_vbCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1236 static HRESULT Global_vbDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1242 static HRESULT Global_vbString(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1248 static HRESULT Global_vbObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1254 static HRESULT Global_vbError(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1260 static HRESULT Global_vbBoolean(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1266 static HRESULT Global_vbVariant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1272 static HRESULT Global_vbDataObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1278 static HRESULT Global_vbDecimal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1284 static HRESULT Global_vbByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1290 static HRESULT Global_vbArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1296 static HRESULT Global_vbTrue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1302 static HRESULT Global_vbFalse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1308 static HRESULT Global_vbUseDefault(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1314 static HRESULT Global_vbBinaryCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1320 static HRESULT Global_vbTextCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1326 static HRESULT Global_vbDatabaseCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1332 static HRESULT Global_vbGeneralDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1338 static HRESULT Global_vbLongDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1344 static HRESULT Global_vbShortDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1350 static HRESULT Global_vbLongTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1356 static HRESULT Global_vbShortTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1362 static HRESULT Global_vbObjectError(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1368 static HRESULT Global_vbBlack(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1374 static HRESULT Global_vbBlue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1380 static HRESULT Global_vbCyan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1386 static HRESULT Global_vbGreen(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1392 static HRESULT Global_vbMagenta(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1398 static HRESULT Global_vbRed(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1404 static HRESULT Global_vbWhite(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1410 static HRESULT Global_vbYellow(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1416 static HRESULT Global_vbCr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1422 static HRESULT Global_vbCrLf(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1428 static HRESULT Global_vbNewLine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1434 static HRESULT Global_vbFormFeed(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1440 static HRESULT Global_vbLf(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1446 static HRESULT Global_vbNullChar(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1452 static HRESULT Global_vbNullString(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1458 static HRESULT Global_vbTab(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1464 static HRESULT Global_vbVerticalTab(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1470 static HRESULT Global_vbMsgBoxHelpButton(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1476 static HRESULT Global_vbMsgBoxSetForeground(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1482 static HRESULT Global_vbMsgBoxRight(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1488 static HRESULT Global_vbMsgBoxRtlReading(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1494 static const builtin_prop_t global_props[] = {
1495 {DISPID_GLOBAL_VBUSESYSTEM, Global_vbUseSystem, BP_GET},
1496 {DISPID_GLOBAL_USESYSTEMDAYOFWEEK, Global_vbUseSystemDayOfWeek, BP_GET},
1497 {DISPID_GLOBAL_VBSUNDAY, Global_vbSunday, BP_GET},
1498 {DISPID_GLOBAL_VBMONDAY, Global_vbMonday, BP_GET},
1499 {DISPID_GLOBAL_VBTUESDAY, Global_vbTuesday, BP_GET},
1500 {DISPID_GLOBAL_VBWEDNESDAY, Global_vbWednesday, BP_GET},
1501 {DISPID_GLOBAL_VBTHURSDAY, Global_vbThursday, BP_GET},
1502 {DISPID_GLOBAL_VBFRIDAY, Global_vbFriday, BP_GET},
1503 {DISPID_GLOBAL_VBSATURDAY, Global_vbSaturday, BP_GET},
1504 {DISPID_GLOBAL_VBFIRSTJAN1, Global_vbFirstJan1, BP_GET},
1505 {DISPID_GLOBAL_VBFIRSTFOURDAYS, Global_vbFirstFourDays, BP_GET},
1506 {DISPID_GLOBAL_VBFIRSTFULLWEEK, Global_vbFirstFullWeek, BP_GET},
1507 {DISPID_GLOBAL_VBOKONLY, Global_vbOKOnly, BP_GET},
1508 {DISPID_GLOBAL_VBOKCANCEL, Global_vbOKCancel, BP_GET},
1509 {DISPID_GLOBAL_VBABORTRETRYIGNORE, Global_vbAbortRetryIgnore, BP_GET},
1510 {DISPID_GLOBAL_VBYESNOCANCEL, Global_vbYesNoCancel, BP_GET},
1511 {DISPID_GLOBAL_VBYESNO, Global_vbYesNo, BP_GET},
1512 {DISPID_GLOBAL_VBRETRYCANCEL, Global_vbRetryCancel, BP_GET},
1513 {DISPID_GLOBAL_VBCRITICAL, Global_vbCritical, BP_GET},
1514 {DISPID_GLOBAL_VBQUESTION, Global_vbQuestion, BP_GET},
1515 {DISPID_GLOBAL_VBEXCLAMATION, Global_vbExclamation, BP_GET},
1516 {DISPID_GLOBAL_VBINFORMATION, Global_vbInformation, BP_GET},
1517 {DISPID_GLOBAL_VBDEFAULTBUTTON1, Global_vbDefaultButton1, BP_GET},
1518 {DISPID_GLOBAL_VBDEFAULTBUTTON2, Global_vbDefaultButton2, BP_GET},
1519 {DISPID_GLOBAL_VBDEFAULTBUTTON3, Global_vbDefaultButton3, BP_GET},
1520 {DISPID_GLOBAL_VBDEFAULTBUTTON4, Global_vbDefaultButton4, BP_GET},
1521 {DISPID_GLOBAL_VBAPPLICATIONMODAL, Global_vbApplicationModal, BP_GET},
1522 {DISPID_GLOBAL_VBSYSTEMMODAL, Global_vbSystemModal, BP_GET},
1523 {DISPID_GLOBAL_VBOK, Global_vbOK, BP_GET},
1524 {DISPID_GLOBAL_VBCANCEL, Global_vbCancel, BP_GET},
1525 {DISPID_GLOBAL_VBABORT, Global_vbAbort, BP_GET},
1526 {DISPID_GLOBAL_VBRETRY, Global_vbRetry, BP_GET},
1527 {DISPID_GLOBAL_VBIGNORE, Global_vbIgnore, BP_GET},
1528 {DISPID_GLOBAL_VBYES, Global_vbYes, BP_GET},
1529 {DISPID_GLOBAL_VBNO, Global_vbNo, BP_GET},
1530 {DISPID_GLOBAL_VBEMPTY, Global_vbEmpty, BP_GET},
1531 {DISPID_GLOBAL_VBNULL, Global_vbNull, BP_GET},
1532 {DISPID_GLOBAL_VBINTEGER, Global_vbInteger, BP_GET},
1533 {DISPID_GLOBAL_VBLONG, Global_vbLong, BP_GET},
1534 {DISPID_GLOBAL_VBSINGLE, Global_vbSingle, BP_GET},
1535 {DISPID_GLOBAL_VBDOUBLE, Global_vbDouble, BP_GET},
1536 {DISPID_GLOBAL_VBCURRENCY, Global_vbCurrency, BP_GET},
1537 {DISPID_GLOBAL_VBDATE, Global_vbDate, BP_GET},
1538 {DISPID_GLOBAL_VBSTRING, Global_vbString, BP_GET},
1539 {DISPID_GLOBAL_VBOBJECT, Global_vbObject, BP_GET},
1540 {DISPID_GLOBAL_VBERROR, Global_vbError, BP_GET},
1541 {DISPID_GLOBAL_VBBOOLEAN, Global_vbBoolean, BP_GET},
1542 {DISPID_GLOBAL_VBVARIANT, Global_vbVariant, BP_GET},
1543 {DISPID_GLOBAL_VBDATAOBJECT, Global_vbDataObject, BP_GET},
1544 {DISPID_GLOBAL_VBDECIMAL, Global_vbDecimal, BP_GET},
1545 {DISPID_GLOBAL_VBBYTE, Global_vbByte, BP_GET},
1546 {DISPID_GLOBAL_VBARRAY, Global_vbArray, BP_GET},
1547 {DISPID_GLOBAL_VBTRUE, Global_vbTrue, BP_GET},
1548 {DISPID_GLOBAL_VBFALSE, Global_vbFalse, BP_GET},
1549 {DISPID_GLOBAL_VBUSEDEFAULT, Global_vbUseDefault, BP_GET},
1550 {DISPID_GLOBAL_VBBINARYCOMPARE, Global_vbBinaryCompare, BP_GET},
1551 {DISPID_GLOBAL_VBTEXTCOMPARE, Global_vbTextCompare, BP_GET},
1552 {DISPID_GLOBAL_VBDATABASECOMPARE, Global_vbDatabaseCompare, BP_GET},
1553 {DISPID_GLOBAL_VBGENERALDATE, Global_vbGeneralDate, BP_GET},
1554 {DISPID_GLOBAL_VBLONGDATE, Global_vbLongDate, BP_GET},
1555 {DISPID_GLOBAL_VBSHORTDATE, Global_vbShortDate, BP_GET},
1556 {DISPID_GLOBAL_VBLONGTIME, Global_vbLongTime, BP_GET},
1557 {DISPID_GLOBAL_VBSHORTTIME, Global_vbShortTime, BP_GET},
1558 {DISPID_GLOBAL_VBOBJECTERROR, Global_vbObjectError, BP_GET},
1559 {DISPID_GLOBAL_VBBLACK, Global_vbBlack, BP_GET},
1560 {DISPID_GLOBAL_VBBLUE, Global_vbBlue, BP_GET},
1561 {DISPID_GLOBAL_VBCYAN, Global_vbCyan, BP_GET},
1562 {DISPID_GLOBAL_VBGREEN, Global_vbGreen, BP_GET},
1563 {DISPID_GLOBAL_VBMAGENTA, Global_vbMagenta, BP_GET},
1564 {DISPID_GLOBAL_VBRED, Global_vbRed, BP_GET},
1565 {DISPID_GLOBAL_VBWHITE, Global_vbWhite, BP_GET},
1566 {DISPID_GLOBAL_VBYELLOW, Global_vbYellow, BP_GET},
1567 {DISPID_GLOBAL_VBCR, Global_vbCr, BP_GET},
1568 {DISPID_GLOBAL_VBCRLF, Global_vbCrLf, BP_GET},
1569 {DISPID_GLOBAL_VBNEWLINE, Global_vbNewLine, BP_GET},
1570 {DISPID_GLOBAL_VBFORMFEED, Global_vbFormFeed, BP_GET},
1571 {DISPID_GLOBAL_VBLF, Global_vbLf, BP_GET},
1572 {DISPID_GLOBAL_VBNULLCHAR, Global_vbNullChar, BP_GET},
1573 {DISPID_GLOBAL_VBNULLSTRING, Global_vbNullString, BP_GET},
1574 {DISPID_GLOBAL_VBTAB, Global_vbTab, BP_GET},
1575 {DISPID_GLOBAL_VBVERTICALTAB, Global_vbVerticalTab, BP_GET},
1576 {DISPID_GLOBAL_CCUR, Global_CCur, 0, 1},
1577 {DISPID_GLOBAL_CINT, Global_CInt, 0, 1},
1578 {DISPID_GLOBAL_CLNG, Global_CLng, 0, 1},
1579 {DISPID_GLOBAL_CBOOL, Global_CBool, 0, 1},
1580 {DISPID_GLOBAL_CBYTE, Global_CByte, 0, 1},
1581 {DISPID_GLOBAL_CDATE, Global_CDate, 0, 1},
1582 {DISPID_GLOBAL_CDBL, Global_CDbl, 0, 1},
1583 {DISPID_GLOBAL_CSNG, Global_CSng, 0, 1},
1584 {DISPID_GLOBAL_CSTR, Global_CStr, 0, 1},
1585 {DISPID_GLOBAL_HEX, Global_Hex, 0, 1},
1586 {DISPID_GLOBAL_OCT, Global_Oct, 0, 1},
1587 {DISPID_GLOBAL_VARTYPE, Global_VarType, 0, 1},
1588 {DISPID_GLOBAL_ISDATE, Global_IsDate, 0, 1},
1589 {DISPID_GLOBAL_ISEMPTY, Global_IsEmpty, 0, 1},
1590 {DISPID_GLOBAL_ISNULL, Global_IsNull, 0, 1},
1591 {DISPID_GLOBAL_ISNUMERIC, Global_IsNumeric, 0, 1},
1592 {DISPID_GLOBAL_ISARRAY, Global_IsArray, 0, 1},
1593 {DISPID_GLOBAL_ISOBJECT, Global_IsObject, 0, 1},
1594 {DISPID_GLOBAL_ATN, Global_Ant, 0, 1},
1595 {DISPID_GLOBAL_COS, Global_Cos, 0, 1},
1596 {DISPID_GLOBAL_SIN, Global_Sin, 0, 1},
1597 {DISPID_GLOBAL_TAN, Global_Tan, 0, 1},
1598 {DISPID_GLOBAL_EXP, Global_Exp, 0, 1},
1599 {DISPID_GLOBAL_LOG, Global_Log, 0, 1},
1600 {DISPID_GLOBAL_SQR, Global_Sqr, 0, 1},
1601 {DISPID_GLOBAL_RANDOMIZE, Global_Randomize, 0, 1},
1602 {DISPID_GLOBAL_RND, Global_Rnd, 0, 1},
1603 {DISPID_GLOBAL_TIMER, Global_Timer, 0, 0},
1604 {DISPID_GLOBAL_LBOUND, Global_LBound, 0, 1},
1605 {DISPID_GLOBAL_UBOUND, Global_UBound, 0, 1},
1606 {DISPID_GLOBAL_RGB, Global_RGB, 0, 3},
1607 {DISPID_GLOBAL_LEN, Global_Len, 0, 1},
1608 {DISPID_GLOBAL_LENB, Global_LenB, 0, 1},
1609 {DISPID_GLOBAL_LEFT, Global_Left, 0, 2},
1610 {DISPID_GLOBAL_LEFTB, Global_LeftB, 0, 2},
1611 {DISPID_GLOBAL_RIGHT, Global_Right, 0, 2},
1612 {DISPID_GLOBAL_RIGHTB, Global_RightB, 0, 2},
1613 {DISPID_GLOBAL_MID, Global_Mid, 0, 2, 3},
1614 {DISPID_GLOBAL_MIDB, Global_MidB, 0, 2, 3},
1615 {DISPID_GLOBAL_STRCOMP, Global_StrComp, 0, 2, 3},
1616 {DISPID_GLOBAL_LCASE, Global_LCase, 0, 1},
1617 {DISPID_GLOBAL_UCASE, Global_UCase, 0, 1},
1618 {DISPID_GLOBAL_LTRIM, Global_LTrim, 0, 1},
1619 {DISPID_GLOBAL_RTRIM, Global_RTrim, 0, 1},
1620 {DISPID_GLOBAL_TRIM, Global_Trim, 0, 1},
1621 {DISPID_GLOBAL_SPACE, Global_Space, 0, 1},
1622 {DISPID_GLOBAL_STRING, Global_String, 0, 0, 2},
1623 {DISPID_GLOBAL_INSTR, Global_InStr, 0, 2, 4},
1624 {DISPID_GLOBAL_INSTRB, Global_InStrB, 0, 3, 4},
1625 {DISPID_GLOBAL_ASCB, Global_AscB, 0, 1},
1626 {DISPID_GLOBAL_CHRB, Global_ChrB, 0, 1},
1627 {DISPID_GLOBAL_ASC, Global_Asc, 0, 1},
1628 {DISPID_GLOBAL_CHR, Global_Chr, 0, 1},
1629 {DISPID_GLOBAL_ASCW, Global_AscW, 0, 1},
1630 {DISPID_GLOBAL_CHRW, Global_ChrW, 0, 1},
1631 {DISPID_GLOBAL_ABS, Global_Abs, 0, 1},
1632 {DISPID_GLOBAL_FIX, Global_Fix, 0, 1},
1633 {DISPID_GLOBAL_INT, Global_Int, 0, 1},
1634 {DISPID_GLOBAL_SGN, Global_Sgn, 0, 1},
1635 {DISPID_GLOBAL_NOW, Global_Now, 0, 0},
1636 {DISPID_GLOBAL_DATE, Global_Date, 0, 0},
1637 {DISPID_GLOBAL_TIME, Global_Time, 0, 0},
1638 {DISPID_GLOBAL_DAY, Global_Day, 0, 1},
1639 {DISPID_GLOBAL_MONTH, Global_Month, 0, 1},
1640 {DISPID_GLOBAL_WEEKDAY, Global_Weekday, 0, 1, 2},
1641 {DISPID_GLOBAL_YEAR, Global_Year, 0, 1},
1642 {DISPID_GLOBAL_HOUR, Global_Hour, 0, 1},
1643 {DISPID_GLOBAL_MINUTE, Global_Minute, 0, 1},
1644 {DISPID_GLOBAL_SECOND, Global_Second, 0, 1},
1645 {DISPID_GLOBAL_DATEVALUE, Global_DateValue, 0, 1},
1646 {DISPID_GLOBAL_TIMEVALUE, Global_TimeValue, 0, 1},
1647 {DISPID_GLOBAL_DATESERIAL, Global_DateSerial, 0, 3},
1648 {DISPID_GLOBAL_TIMESERIAL, Global_TimeSerial, 0, 3},
1649 {DISPID_GLOBAL_INPUTBOX, Global_InputBox, 0, 1, 7},
1650 {DISPID_GLOBAL_MSGBOX, Global_MsgBox, 0, 1, 5},
1651 {DISPID_GLOBAL_CREATEOBJECT, Global_CreateObject, 0, 1},
1652 {DISPID_GLOBAL_GETOBJECT, Global_GetObject, 0, 0, 2},
1653 {DISPID_GLOBAL_DATEADD, Global_DateAdd, 0, 3},
1654 {DISPID_GLOBAL_DATEDIFF, Global_DateDiff, 0, 3, 5},
1655 {DISPID_GLOBAL_DATEPART, Global_DatePart, 0, 2, 4},
1656 {DISPID_GLOBAL_TYPENAME, Global_TypeName, 0, 1},
1657 {DISPID_GLOBAL_ARRAY, Global_Array, 0, 1},
1658 {DISPID_GLOBAL_ERASE, Global_Erase, 0, 1},
1659 {DISPID_GLOBAL_FILTER, Global_Filter, 0, 2, 4},
1660 {DISPID_GLOBAL_JOIN, Global_Join, 0, 1, 2},
1661 {DISPID_GLOBAL_SPLIT, Global_Split, 0, 1, 4},
1662 {DISPID_GLOBAL_REPLACE, Global_Replace, 0, 3, 6},
1663 {DISPID_GLOBAL_STRREVERSE, Global_StrReverse, 0, 1},
1664 {DISPID_GLOBAL_INSTRREV, Global_InStrRev, 0, 2, 4},
1665 {DISPID_GLOBAL_LOADPICTURE, Global_LoadPicture, 0, 1},
1666 {DISPID_GLOBAL_SCRIPTENGINE, Global_ScriptEngine, 0, 0},
1667 {DISPID_GLOBAL_SCRIPTENGINEMAJORVERSION, Global_ScriptEngineMajorVersion, 0, 0},
1668 {DISPID_GLOBAL_SCRIPTENGINEMINORVERSION, Global_ScriptEngineMinorVersion, 0, 0},
1669 {DISPID_GLOBAL_SCRIPTENGINEBUILDVERSION, Global_ScriptEngineBuildVersion, 0, 0},
1670 {DISPID_GLOBAL_FORMATNUMBER, Global_FormatNumber, 0, 1, 5},
1671 {DISPID_GLOBAL_FORMATCURRENCY, Global_FormatCurrency, 0, 1, 5},
1672 {DISPID_GLOBAL_FORMATPERCENT, Global_FormatPercent, 0, 1, 5},
1673 {DISPID_GLOBAL_FORMATDATETIME, Global_FormatDateTime, 0, 1, 2},
1674 {DISPID_GLOBAL_WEEKDAYNAME, Global_WeekdayName, 0, 3},
1675 {DISPID_GLOBAL_MONTHNAME, Global_MonthName, 0, 1, 2},
1676 {DISPID_GLOBAL_ROUND, Global_Round, 0, 1, 2},
1677 {DISPID_GLOBAL_ESCAPE, Global_Escape, 0, 1},
1678 {DISPID_GLOBAL_UNESCAPE, Global_Unescape, 0, 1},
1679 {DISPID_GLOBAL_EVAL, Global_Eval, 0, 1},
1680 {DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1},
1681 {DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1},
1682 {DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1},
1683 {DISPID_GLOBAL_VBMSGBOXHELPBUTTON, Global_vbMsgBoxHelpButton, BP_GET},
1684 {DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, Global_vbMsgBoxSetForeground, BP_GET},
1685 {DISPID_GLOBAL_VBMSGBOXRIGHT, Global_vbMsgBoxRight, BP_GET},
1686 {DISPID_GLOBAL_VBMSGBOXRTLREADING, Global_vbMsgBoxRtlReading, BP_GET}
1689 HRESULT init_global(script_ctx_t *ctx)
1693 ctx->global_desc.ctx = ctx;
1694 ctx->global_desc.builtin_prop_cnt = sizeof(global_props)/sizeof(*global_props);
1695 ctx->global_desc.builtin_props = global_props;
1697 hres = get_typeinfo(GlobalObj_tid, &ctx->global_desc.typeinfo);
1701 hres = create_vbdisp(&ctx->global_desc, &ctx->global_obj);
1705 ctx->script_desc.ctx = ctx;
1706 hres = create_vbdisp(&ctx->script_desc, &ctx->script_obj);
1710 return init_err(ctx);