dmscript: Merge the IClassFactory implementations.
[wine/testsucceed.git] / dlls / vbscript / tests / vbscript.c
blob7de424f723705413513fcbd8d321212cb6ed13d9
1 /*
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
19 #define COBJMACROS
20 #define CONST_VTABLE
22 #include <initguid.h>
23 #include <ole2.h>
24 #include <activscp.h>
26 #include "wine/test.h"
28 DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4,0xb0, 0x00,0xaa,0x00,0x4a,0x55,0xe8);
30 static void test_vbscript(void)
32 IActiveScriptParse *parser;
33 IActiveScript *vbscript;
34 HRESULT hres;
36 hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
37 &IID_IActiveScript, (void**)&vbscript);
38 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
40 hres = IActiveScript_QueryInterface(vbscript, &IID_IActiveScriptParse, (void**)&parser);
41 ok(hres == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hres);
43 IActiveScriptParse64_Release(parser);
44 IActiveScript_Release(vbscript);
47 static BOOL check_vbscript(void)
49 IActiveScript *vbscript;
50 HRESULT hres;
52 hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
53 &IID_IActiveScript, (void**)&vbscript);
54 if(SUCCEEDED(hres))
55 IActiveScript_Release(vbscript);
57 return hres == S_OK;
61 START_TEST(vbscript)
63 CoInitialize(NULL);
65 if(check_vbscript())
66 test_vbscript();
67 else
68 win_skip("VBScript engine not available\n");
70 CoUninitialize();