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
20 #include "vbscript_defs.h"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
26 static HRESULT Global_CCur(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
32 static HRESULT Global_CInt(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
38 static HRESULT Global_CLng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
44 static HRESULT Global_CBool(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
50 static HRESULT Global_CByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
56 static HRESULT Global_CDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
62 static HRESULT Global_CDbl(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
68 static HRESULT Global_CSng(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
74 static HRESULT Global_CStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
80 static HRESULT Global_Hex(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
86 static HRESULT Global_Oct(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
92 static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
98 static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
104 static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
110 static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
116 static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
122 static HRESULT Global_IsArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
128 static HRESULT Global_IsObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
130 TRACE("(%s)\n", debugstr_variant(arg));
132 if(V_VT(arg) == (VT_VARIANT|VT_BYREF))
133 arg = V_VARIANTREF(arg);
137 V_BOOL(res) = V_VT(arg) == VT_DISPATCH ? VARIANT_TRUE : VARIANT_FALSE;
142 static HRESULT Global_Ant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
148 static HRESULT Global_Cos(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
154 static HRESULT Global_Sin(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
160 static HRESULT Global_Tan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
166 static HRESULT Global_Exp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
172 static HRESULT Global_Log(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
178 static HRESULT Global_Sqr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
184 static HRESULT Global_Randomize(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
190 static HRESULT Global_Rnd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
196 static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
202 static HRESULT Global_LBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
208 static HRESULT Global_UBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
214 static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
220 static HRESULT Global_Len(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
226 static HRESULT Global_LenB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
232 static HRESULT Global_Left(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
238 static HRESULT Global_LeftB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
244 static HRESULT Global_Right(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
250 static HRESULT Global_RightB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
256 static HRESULT Global_Mid(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
262 static HRESULT Global_MidB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
268 static HRESULT Global_StrComp(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
274 static HRESULT Global_LCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
280 static HRESULT Global_UCase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
286 static HRESULT Global_LTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
292 static HRESULT Global_RTrim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
298 static HRESULT Global_Trim(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
304 static HRESULT Global_Space(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
310 static HRESULT Global_String(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
316 static HRESULT Global_InStr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
322 static HRESULT Global_InStrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
328 static HRESULT Global_AscB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
334 static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
340 static HRESULT Global_Asc(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
346 static HRESULT Global_Chr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
352 static HRESULT Global_AscW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
358 static HRESULT Global_ChrW(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
364 static HRESULT Global_Abs(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
370 static HRESULT Global_Fix(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
376 static HRESULT Global_Int(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
382 static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
388 static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
394 static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
400 static HRESULT Global_Time(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
406 static HRESULT Global_Day(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
412 static HRESULT Global_Month(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
418 static HRESULT Global_Weekday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
424 static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
430 static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
436 static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
442 static HRESULT Global_Second(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
448 static HRESULT Global_DateValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
454 static HRESULT Global_TimeValue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
460 static HRESULT Global_DateSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
466 static HRESULT Global_TimeSerial(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
472 static HRESULT Global_InputBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
478 static HRESULT Global_MsgBox(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
484 static HRESULT Global_CreateObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
490 static HRESULT Global_GetObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
496 static HRESULT Global_DateAdd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
502 static HRESULT Global_DateDiff(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
508 static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
514 static HRESULT Global_TypeName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
520 static HRESULT Global_Array(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
526 static HRESULT Global_Erase(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
532 static HRESULT Global_Filter(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
538 static HRESULT Global_Join(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
544 static HRESULT Global_Split(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
550 static HRESULT Global_Replace(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
556 static HRESULT Global_StrReverse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
562 static HRESULT Global_InStrRev(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
568 static HRESULT Global_LoadPicture(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
574 static HRESULT Global_ScriptEngine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
580 static HRESULT Global_ScriptEngineMajorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
586 static HRESULT Global_ScriptEngineMinorVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
592 static HRESULT Global_ScriptEngineBuildVersion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
598 static HRESULT Global_FormatNumber(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
604 static HRESULT Global_FormatCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
610 static HRESULT Global_FormatPercent(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
616 static HRESULT Global_FormatDateTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
622 static HRESULT Global_WeekdayName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
628 static HRESULT Global_MonthName(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
634 static HRESULT Global_Round(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
640 static HRESULT Global_Escape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
646 static HRESULT Global_Unescape(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
652 static HRESULT Global_Eval(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
658 static HRESULT Global_Execute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
664 static HRESULT Global_ExecuteGlobal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
670 static HRESULT Global_GetRef(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
676 static HRESULT Global_vbUseSystem(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
682 static HRESULT Global_vbUseSystemDayOfWeek(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
688 static HRESULT Global_vbSunday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
694 static HRESULT Global_vbMonday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
700 static HRESULT Global_vbTuesday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
706 static HRESULT Global_vbWednesday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
712 static HRESULT Global_vbThursday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
718 static HRESULT Global_vbFriday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
724 static HRESULT Global_vbSaturday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
730 static HRESULT Global_vbFirstJan1(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
736 static HRESULT Global_vbFirstFourDays(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
742 static HRESULT Global_vbFirstFullWeek(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
748 static HRESULT Global_vbOKOnly(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
754 static HRESULT Global_vbOKCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
760 static HRESULT Global_vbAbortRetryIgnore(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
766 static HRESULT Global_vbYesNoCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
772 static HRESULT Global_vbYesNo(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
778 static HRESULT Global_vbRetryCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
784 static HRESULT Global_vbCritical(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
790 static HRESULT Global_vbQuestion(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
796 static HRESULT Global_vbExclamation(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
802 static HRESULT Global_vbInformation(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
808 static HRESULT Global_vbDefaultButton1(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
814 static HRESULT Global_vbDefaultButton2(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
820 static HRESULT Global_vbDefaultButton3(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
826 static HRESULT Global_vbDefaultButton4(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
832 static HRESULT Global_vbApplicationModal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
838 static HRESULT Global_vbSystemModal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
844 static HRESULT Global_vbOK(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
850 static HRESULT Global_vbCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
856 static HRESULT Global_vbAbort(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
862 static HRESULT Global_vbRetry(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
868 static HRESULT Global_vbIgnore(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
874 static HRESULT Global_vbYes(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
880 static HRESULT Global_vbNo(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
886 static HRESULT Global_vbEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
892 static HRESULT Global_vbNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
898 static HRESULT Global_vbInteger(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
904 static HRESULT Global_vbLong(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
910 static HRESULT Global_vbSingle(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
916 static HRESULT Global_vbDouble(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
922 static HRESULT Global_vbCurrency(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
928 static HRESULT Global_vbDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
934 static HRESULT Global_vbString(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
940 static HRESULT Global_vbObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
946 static HRESULT Global_vbError(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
952 static HRESULT Global_vbBoolean(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
958 static HRESULT Global_vbVariant(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
964 static HRESULT Global_vbDataObject(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
970 static HRESULT Global_vbDecimal(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
976 static HRESULT Global_vbByte(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
982 static HRESULT Global_vbArray(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
988 static HRESULT Global_vbTrue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
994 static HRESULT Global_vbFalse(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1000 static HRESULT Global_vbUseDefault(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1006 static HRESULT Global_vbBinaryCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1012 static HRESULT Global_vbTextCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1018 static HRESULT Global_vbDatabaseCompare(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1024 static HRESULT Global_vbGeneralDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1030 static HRESULT Global_vbLongDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1036 static HRESULT Global_vbShortDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1042 static HRESULT Global_vbLongTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1048 static HRESULT Global_vbShortTime(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1054 static HRESULT Global_vbObjectError(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1060 static HRESULT Global_vbBlack(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1066 static HRESULT Global_vbBlue(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1072 static HRESULT Global_vbCyan(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1078 static HRESULT Global_vbGreen(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1084 static HRESULT Global_vbMagenta(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1090 static HRESULT Global_vbRed(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1096 static HRESULT Global_vbWhite(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1102 static HRESULT Global_vbYellow(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1108 static HRESULT Global_vbCr(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1114 static HRESULT Global_vbCrLf(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1120 static HRESULT Global_vbNewLine(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1126 static HRESULT Global_vbFormFeed(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1132 static HRESULT Global_vbLf(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1138 static HRESULT Global_vbNullChar(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1144 static HRESULT Global_vbNullString(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1150 static HRESULT Global_vbTab(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1156 static HRESULT Global_vbVerticalTab(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1162 static HRESULT Global_vbMsgBoxHelpButton(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1168 static HRESULT Global_vbMsgBoxSetForeground(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1174 static HRESULT Global_vbMsgBoxRight(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1180 static HRESULT Global_vbMsgBoxRtlReading(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
1186 static const builtin_prop_t global_props[] = {
1187 {DISPID_GLOBAL_VBUSESYSTEM, Global_vbUseSystem, BP_GET},
1188 {DISPID_GLOBAL_USESYSTEMDAYOFWEEK, Global_vbUseSystemDayOfWeek, BP_GET},
1189 {DISPID_GLOBAL_VBSUNDAY, Global_vbSunday, BP_GET},
1190 {DISPID_GLOBAL_VBMONDAY, Global_vbMonday, BP_GET},
1191 {DISPID_GLOBAL_VBTUESDAY, Global_vbTuesday, BP_GET},
1192 {DISPID_GLOBAL_VBWEDNESDAY, Global_vbWednesday, BP_GET},
1193 {DISPID_GLOBAL_VBTHURSDAY, Global_vbThursday, BP_GET},
1194 {DISPID_GLOBAL_VBFRIDAY, Global_vbFriday, BP_GET},
1195 {DISPID_GLOBAL_VBSATURDAY, Global_vbSaturday, BP_GET},
1196 {DISPID_GLOBAL_VBFIRSTJAN1, Global_vbFirstJan1, BP_GET},
1197 {DISPID_GLOBAL_VBFIRSTFOURDAYS, Global_vbFirstFourDays, BP_GET},
1198 {DISPID_GLOBAL_VBFIRSTFULLWEEK, Global_vbFirstFullWeek, BP_GET},
1199 {DISPID_GLOBAL_VBOKONLY, Global_vbOKOnly, BP_GET},
1200 {DISPID_GLOBAL_VBOKCANCEL, Global_vbOKCancel, BP_GET},
1201 {DISPID_GLOBAL_VBABORTRETRYIGNORE, Global_vbAbortRetryIgnore, BP_GET},
1202 {DISPID_GLOBAL_VBYESNOCANCEL, Global_vbYesNoCancel, BP_GET},
1203 {DISPID_GLOBAL_VBYESNO, Global_vbYesNo, BP_GET},
1204 {DISPID_GLOBAL_VBRETRYCANCEL, Global_vbRetryCancel, BP_GET},
1205 {DISPID_GLOBAL_VBCRITICAL, Global_vbCritical, BP_GET},
1206 {DISPID_GLOBAL_VBQUESTION, Global_vbQuestion, BP_GET},
1207 {DISPID_GLOBAL_VBEXCLAMATION, Global_vbExclamation, BP_GET},
1208 {DISPID_GLOBAL_VBINFORMATION, Global_vbInformation, BP_GET},
1209 {DISPID_GLOBAL_VBDEFAULTBUTTON1, Global_vbDefaultButton1, BP_GET},
1210 {DISPID_GLOBAL_VBDEFAULTBUTTON2, Global_vbDefaultButton2, BP_GET},
1211 {DISPID_GLOBAL_VBDEFAULTBUTTON3, Global_vbDefaultButton3, BP_GET},
1212 {DISPID_GLOBAL_VBDEFAULTBUTTON4, Global_vbDefaultButton4, BP_GET},
1213 {DISPID_GLOBAL_VBAPPLICATIONMODAL, Global_vbApplicationModal, BP_GET},
1214 {DISPID_GLOBAL_VBSYSTEMMODAL, Global_vbSystemModal, BP_GET},
1215 {DISPID_GLOBAL_VBOK, Global_vbOK, BP_GET},
1216 {DISPID_GLOBAL_VBCANCEL, Global_vbCancel, BP_GET},
1217 {DISPID_GLOBAL_VBABORT, Global_vbAbort, BP_GET},
1218 {DISPID_GLOBAL_VBRETRY, Global_vbRetry, BP_GET},
1219 {DISPID_GLOBAL_VBIGNORE, Global_vbIgnore, BP_GET},
1220 {DISPID_GLOBAL_VBYES, Global_vbYes, BP_GET},
1221 {DISPID_GLOBAL_VBNO, Global_vbNo, BP_GET},
1222 {DISPID_GLOBAL_VBEMPTY, Global_vbEmpty, BP_GET},
1223 {DISPID_GLOBAL_VBNULL, Global_vbNull, BP_GET},
1224 {DISPID_GLOBAL_VBINTEGER, Global_vbInteger, BP_GET},
1225 {DISPID_GLOBAL_VBLONG, Global_vbLong, BP_GET},
1226 {DISPID_GLOBAL_VBSINGLE, Global_vbSingle, BP_GET},
1227 {DISPID_GLOBAL_VBDOUBLE, Global_vbDouble, BP_GET},
1228 {DISPID_GLOBAL_VBCURRENCY, Global_vbCurrency, BP_GET},
1229 {DISPID_GLOBAL_VBDATE, Global_vbDate, BP_GET},
1230 {DISPID_GLOBAL_VBSTRING, Global_vbString, BP_GET},
1231 {DISPID_GLOBAL_VBOBJECT, Global_vbObject, BP_GET},
1232 {DISPID_GLOBAL_VBERROR, Global_vbError, BP_GET},
1233 {DISPID_GLOBAL_VBBOOLEAN, Global_vbBoolean, BP_GET},
1234 {DISPID_GLOBAL_VBVARIANT, Global_vbVariant, BP_GET},
1235 {DISPID_GLOBAL_VBDATAOBJECT, Global_vbDataObject, BP_GET},
1236 {DISPID_GLOBAL_VBDECIMAL, Global_vbDecimal, BP_GET},
1237 {DISPID_GLOBAL_VBBYTE, Global_vbByte, BP_GET},
1238 {DISPID_GLOBAL_VBARRAY, Global_vbArray, BP_GET},
1239 {DISPID_GLOBAL_VBTRUE, Global_vbTrue, BP_GET},
1240 {DISPID_GLOBAL_VBFALSE, Global_vbFalse, BP_GET},
1241 {DISPID_GLOBAL_VBUSEDEFAULT, Global_vbUseDefault, BP_GET},
1242 {DISPID_GLOBAL_VBBINARYCOMPARE, Global_vbBinaryCompare, BP_GET},
1243 {DISPID_GLOBAL_VBTEXTCOMPARE, Global_vbTextCompare, BP_GET},
1244 {DISPID_GLOBAL_VBDATABASECOMPARE, Global_vbDatabaseCompare, BP_GET},
1245 {DISPID_GLOBAL_VBGENERALDATE, Global_vbGeneralDate, BP_GET},
1246 {DISPID_GLOBAL_VBLONGDATE, Global_vbLongDate, BP_GET},
1247 {DISPID_GLOBAL_VBSHORTDATE, Global_vbShortDate, BP_GET},
1248 {DISPID_GLOBAL_VBLONGTIME, Global_vbLongTime, BP_GET},
1249 {DISPID_GLOBAL_VBSHORTTIME, Global_vbShortTime, BP_GET},
1250 {DISPID_GLOBAL_VBOBJECTERROR, Global_vbObjectError, BP_GET},
1251 {DISPID_GLOBAL_VBBLACK, Global_vbBlack, BP_GET},
1252 {DISPID_GLOBAL_VBBLUE, Global_vbBlue, BP_GET},
1253 {DISPID_GLOBAL_VBCYAN, Global_vbCyan, BP_GET},
1254 {DISPID_GLOBAL_VBGREEN, Global_vbGreen, BP_GET},
1255 {DISPID_GLOBAL_VBMAGENTA, Global_vbMagenta, BP_GET},
1256 {DISPID_GLOBAL_VBRED, Global_vbRed, BP_GET},
1257 {DISPID_GLOBAL_VBWHITE, Global_vbWhite, BP_GET},
1258 {DISPID_GLOBAL_VBYELLOW, Global_vbYellow, BP_GET},
1259 {DISPID_GLOBAL_VBCR, Global_vbCr, BP_GET},
1260 {DISPID_GLOBAL_VBCRLF, Global_vbCrLf, BP_GET},
1261 {DISPID_GLOBAL_VBNEWLINE, Global_vbNewLine, BP_GET},
1262 {DISPID_GLOBAL_VBFORMFEED, Global_vbFormFeed, BP_GET},
1263 {DISPID_GLOBAL_VBLF, Global_vbLf, BP_GET},
1264 {DISPID_GLOBAL_VBNULLCHAR, Global_vbNullChar, BP_GET},
1265 {DISPID_GLOBAL_VBNULLSTRING, Global_vbNullString, BP_GET},
1266 {DISPID_GLOBAL_VBTAB, Global_vbTab, BP_GET},
1267 {DISPID_GLOBAL_VBVERTICALTAB, Global_vbVerticalTab, BP_GET},
1268 {DISPID_GLOBAL_CCUR, Global_CCur, 0, 1},
1269 {DISPID_GLOBAL_CINT, Global_CInt, 0, 1},
1270 {DISPID_GLOBAL_CLNG, Global_CLng, 0, 1},
1271 {DISPID_GLOBAL_CBOOL, Global_CBool, 0, 1},
1272 {DISPID_GLOBAL_CBYTE, Global_CByte, 0, 1},
1273 {DISPID_GLOBAL_CDATE, Global_CDate, 0, 1},
1274 {DISPID_GLOBAL_CDBL, Global_CDbl, 0, 1},
1275 {DISPID_GLOBAL_CSNG, Global_CSng, 0, 1},
1276 {DISPID_GLOBAL_CSTR, Global_CStr, 0, 1},
1277 {DISPID_GLOBAL_HEX, Global_Hex, 0, 1},
1278 {DISPID_GLOBAL_OCT, Global_Oct, 0, 1},
1279 {DISPID_GLOBAL_VARTYPE, Global_VarType, 0, 1},
1280 {DISPID_GLOBAL_ISDATE, Global_IsDate, 0, 1},
1281 {DISPID_GLOBAL_ISEMPTY, Global_IsEmpty, 0, 1},
1282 {DISPID_GLOBAL_ISNULL, Global_IsNull, 0, 1},
1283 {DISPID_GLOBAL_ISNUMERIC, Global_IsNumeric, 0, 1},
1284 {DISPID_GLOBAL_ISARRAY, Global_IsArray, 0, 1},
1285 {DISPID_GLOBAL_ISOBJECT, Global_IsObject, 0, 1},
1286 {DISPID_GLOBAL_ATN, Global_Ant, 0, 1},
1287 {DISPID_GLOBAL_COS, Global_Cos, 0, 1},
1288 {DISPID_GLOBAL_SIN, Global_Sin, 0, 1},
1289 {DISPID_GLOBAL_TAN, Global_Tan, 0, 1},
1290 {DISPID_GLOBAL_EXP, Global_Exp, 0, 1},
1291 {DISPID_GLOBAL_LOG, Global_Log, 0, 1},
1292 {DISPID_GLOBAL_SQR, Global_Sqr, 0, 1},
1293 {DISPID_GLOBAL_RANDOMIZE, Global_Randomize, 0, 1},
1294 {DISPID_GLOBAL_RND, Global_Rnd, 0, 1},
1295 {DISPID_GLOBAL_TIMER, Global_Timer, 0, 0},
1296 {DISPID_GLOBAL_LBOUND, Global_LBound, 0, 1},
1297 {DISPID_GLOBAL_UBOUND, Global_UBound, 0, 1},
1298 {DISPID_GLOBAL_RGB, Global_RGB, 0, 3},
1299 {DISPID_GLOBAL_LEN, Global_Len, 0, 1},
1300 {DISPID_GLOBAL_LENB, Global_LenB, 0, 1},
1301 {DISPID_GLOBAL_LEFT, Global_Left, 0, 2},
1302 {DISPID_GLOBAL_LEFTB, Global_LeftB, 0, 2},
1303 {DISPID_GLOBAL_RIGHT, Global_Right, 0, 2},
1304 {DISPID_GLOBAL_RIGHTB, Global_RightB, 0, 2},
1305 {DISPID_GLOBAL_MID, Global_Mid, 0, 2, 3},
1306 {DISPID_GLOBAL_MIDB, Global_MidB, 0, 2, 3},
1307 {DISPID_GLOBAL_STRCOMP, Global_StrComp, 0, 2, 3},
1308 {DISPID_GLOBAL_LCASE, Global_LCase, 0, 1},
1309 {DISPID_GLOBAL_UCASE, Global_UCase, 0, 1},
1310 {DISPID_GLOBAL_LTRIM, Global_LTrim, 0, 1},
1311 {DISPID_GLOBAL_RTRIM, Global_RTrim, 0, 1},
1312 {DISPID_GLOBAL_TRIM, Global_Trim, 0, 1},
1313 {DISPID_GLOBAL_SPACE, Global_Space, 0, 1},
1314 {DISPID_GLOBAL_STRING, Global_String, 0, 0, 2},
1315 {DISPID_GLOBAL_INSTR, Global_InStr, 0, 3, 4},
1316 {DISPID_GLOBAL_INSTRB, Global_InStrB, 0, 3, 4},
1317 {DISPID_GLOBAL_ASCB, Global_AscB, 0, 1},
1318 {DISPID_GLOBAL_CHRB, Global_ChrB, 0, 1},
1319 {DISPID_GLOBAL_ASC, Global_Asc, 0, 1},
1320 {DISPID_GLOBAL_CHR, Global_Chr, 0, 1},
1321 {DISPID_GLOBAL_ASCW, Global_AscW, 0, 1},
1322 {DISPID_GLOBAL_CHRW, Global_ChrW, 0, 1},
1323 {DISPID_GLOBAL_ABS, Global_Abs, 0, 1},
1324 {DISPID_GLOBAL_FIX, Global_Fix, 0, 1},
1325 {DISPID_GLOBAL_INT, Global_Int, 0, 1},
1326 {DISPID_GLOBAL_SGN, Global_Sgn, 0, 1},
1327 {DISPID_GLOBAL_NOW, Global_Now, 0, 0},
1328 {DISPID_GLOBAL_DATE, Global_Date, 0, 0},
1329 {DISPID_GLOBAL_TIME, Global_Time, 0, 0},
1330 {DISPID_GLOBAL_DAY, Global_Day, 0, 1},
1331 {DISPID_GLOBAL_MONTH, Global_Month, 0, 1},
1332 {DISPID_GLOBAL_WEEKDAY, Global_Weekday, 0, 1, 2},
1333 {DISPID_GLOBAL_YEAR, Global_Year, 0, 1},
1334 {DISPID_GLOBAL_HOUR, Global_Hour, 0, 1},
1335 {DISPID_GLOBAL_MINUTE, Global_Minute, 0, 1},
1336 {DISPID_GLOBAL_SECOND, Global_Second, 0, 1},
1337 {DISPID_GLOBAL_DATEVALUE, Global_DateValue, 0, 1},
1338 {DISPID_GLOBAL_TIMEVALUE, Global_TimeValue, 0, 1},
1339 {DISPID_GLOBAL_DATESERIAL, Global_DateSerial, 0, 3},
1340 {DISPID_GLOBAL_TIMESERIAL, Global_TimeSerial, 0, 3},
1341 {DISPID_GLOBAL_INPUTBOX, Global_InputBox, 0, 1, 7},
1342 {DISPID_GLOBAL_MSGBOX, Global_MsgBox, 0, 1, 5},
1343 {DISPID_GLOBAL_CREATEOBJECT, Global_CreateObject, 0, 1},
1344 {DISPID_GLOBAL_GETOBJECT, Global_GetObject, 0, 0, 2},
1345 {DISPID_GLOBAL_DATEADD, Global_DateAdd, 0, 3},
1346 {DISPID_GLOBAL_DATEDIFF, Global_DateDiff, 0, 3, 5},
1347 {DISPID_GLOBAL_DATEPART, Global_DatePart, 0, 2, 4},
1348 {DISPID_GLOBAL_TYPENAME, Global_TypeName, 0, 1},
1349 {DISPID_GLOBAL_ARRAY, Global_Array, 0, 1},
1350 {DISPID_GLOBAL_ERASE, Global_Erase, 0, 1},
1351 {DISPID_GLOBAL_FILTER, Global_Filter, 0, 2, 4},
1352 {DISPID_GLOBAL_JOIN, Global_Join, 0, 1, 2},
1353 {DISPID_GLOBAL_SPLIT, Global_Split, 0, 1, 4},
1354 {DISPID_GLOBAL_REPLACE, Global_Replace, 0, 3, 6},
1355 {DISPID_GLOBAL_STRREVERSE, Global_StrReverse, 0, 1},
1356 {DISPID_GLOBAL_INSTRREV, Global_InStrRev, 0, 2, 4},
1357 {DISPID_GLOBAL_LOADPICTURE, Global_LoadPicture, 0, 1},
1358 {DISPID_GLOBAL_SCRIPTENGINE, Global_ScriptEngine, 0, 0},
1359 {DISPID_GLOBAL_SCRIPTENGINEMAJORVERSION, Global_ScriptEngineMajorVersion, 0, 0},
1360 {DISPID_GLOBAL_SCRIPTENGINEMINORVERSION, Global_ScriptEngineMinorVersion, 0, 0},
1361 {DISPID_GLOBAL_SCRIPTENGINEBUILDVERSION, Global_ScriptEngineBuildVersion, 0, 0},
1362 {DISPID_GLOBAL_FORMATNUMBER, Global_FormatNumber, 0, 1, 5},
1363 {DISPID_GLOBAL_FORMATCURRENCY, Global_FormatCurrency, 0, 1, 5},
1364 {DISPID_GLOBAL_FORMATPERCENT, Global_FormatPercent, 0, 1, 5},
1365 {DISPID_GLOBAL_FORMATDATETIME, Global_FormatDateTime, 0, 1, 2},
1366 {DISPID_GLOBAL_WEEKDAYNAME, Global_WeekdayName, 0, 3},
1367 {DISPID_GLOBAL_MONTHNAME, Global_MonthName, 0, 1, 2},
1368 {DISPID_GLOBAL_ROUND, Global_Round, 0, 1, 2},
1369 {DISPID_GLOBAL_ESCAPE, Global_Escape, 0, 1},
1370 {DISPID_GLOBAL_UNESCAPE, Global_Unescape, 0, 1},
1371 {DISPID_GLOBAL_EVAL, Global_Eval, 0, 1},
1372 {DISPID_GLOBAL_EXECUTE, Global_Execute, 0, 1},
1373 {DISPID_GLOBAL_EXECUTEGLOBAL, Global_ExecuteGlobal, 0, 1},
1374 {DISPID_GLOBAL_GETREF, Global_GetRef, 0, 1},
1375 {DISPID_GLOBAL_VBMSGBOXHELPBUTTON, Global_vbMsgBoxHelpButton, BP_GET},
1376 {DISPID_GLOBAL_VBMSGBOXSETFOREGROUND, Global_vbMsgBoxSetForeground, BP_GET},
1377 {DISPID_GLOBAL_VBMSGBOXRIGHT, Global_vbMsgBoxRight, BP_GET},
1378 {DISPID_GLOBAL_VBMSGBOXRTLREADING, Global_vbMsgBoxRtlReading, BP_GET}
1381 HRESULT init_global(script_ctx_t *ctx)
1385 ctx->global_desc.ctx = ctx;
1386 ctx->global_desc.builtin_prop_cnt = sizeof(global_props)/sizeof(*global_props);
1387 ctx->global_desc.builtin_props = global_props;
1389 hres = get_typeinfo(GlobalObj_tid, &ctx->global_desc.typeinfo);
1393 hres = create_vbdisp(&ctx->global_desc, &ctx->global_obj);
1397 ctx->script_desc.ctx = ctx;
1398 hres = create_vbdisp(&ctx->script_desc, &ctx->script_obj);
1402 return init_err(ctx);