From 0c0e6f537166fc7883a02a807b1018f8aa947560 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 3 Oct 2012 15:57:25 +0400 Subject: [PATCH] vbscript: Support vb* constants for message box return value. --- dlls/vbscript/global.c | 28 ++++++++++++++-------------- dlls/vbscript/tests/api.vbs | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 32eebdca364..76a035b6a50 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -1690,44 +1690,44 @@ static HRESULT Global_vbSystemModal(vbdisp_t *This, VARIANT *arg, unsigned args_ static HRESULT Global_vbOK(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDOK); } static HRESULT Global_vbCancel(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDCANCEL); } static HRESULT Global_vbAbort(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDABORT); } static HRESULT Global_vbRetry(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDRETRY); } static HRESULT Global_vbIgnore(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDIGNORE); } static HRESULT Global_vbYes(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDYES); } static HRESULT Global_vbNo(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return return_short(res, IDNO); } static HRESULT Global_vbEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index fc87c59a100..47fae0cd9d7 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -312,4 +312,19 @@ Call ok(getVT(vbYesNo) = "VT_I2", "getVT(vbYesNo) = " & getVT(vbYesNo)) Call ok(vbRetryCancel = 5, "vbRetryCancel = " & vbRetryCancel) Call ok(getVT(vbRetryCancel) = "VT_I2", "getVT(vbRetryCancel) = " & getVT(vbRetryCancel)) +Call ok(vbOK = 1, "vbOK = " & vbOK) +Call ok(getVT(vbOK) = "VT_I2", "getVT(vbOK) = " & getVT(vbOK)) +Call ok(vbCancel = 2, "vbCancel = " & vbCancel) +Call ok(getVT(vbCancel) = "VT_I2", "getVT(vbCancel) = " & getVT(vbCancel)) +Call ok(vbAbort = 3, "vbAbort = " & vbAbort) +Call ok(getVT(vbAbort) = "VT_I2", "getVT(vbAbort) = " & getVT(vbAbort)) +Call ok(vbRetry = 4, "vbRetry = " & vbRetry) +Call ok(getVT(vbRetry) = "VT_I2", "getVT(vbRetry) = " & getVT(vbRetry)) +Call ok(vbIgnore = 5, "vbIgnore = " & vbIgnore) +Call ok(getVT(vbIgnore) = "VT_I2", "getVT(vbIgnore) = " & getVT(vbIgnore)) +Call ok(vbYes = 6, "vbYes = " & vbYes) +Call ok(getVT(vbYes) = "VT_I2", "getVT(vbYes) = " & getVT(vbYes)) +Call ok(vbNo = 7, "vbNo = " & vbNo) +Call ok(getVT(vbNo) = "VT_I2", "getVT(vbNo) = " & getVT(vbNo)) + Call reportSuccess()