Hi,
On 2019/4/25 下午9:35, Nikolay Sivov wrote:
On 4/25/19 4:11 PM, Jactry Zeng wrote:
+ if (FAILED(IScriptControl_get_State(iface, &state)) || (state != Initialized)) + return E_FAIL;
You don't need to call methods internally to access state.
Because I want to check This->host, too. And I'm not sure if there is any other thing should be checked in the future.
I thought accessing the state by get_State() maybe more safe?
+ language = a2bstr("vbscript"); + hr = IScriptControl_put_Language(sc, language); + ok(hr == S_OK, "IScriptControl_put_Language failed: 0x%08x.\n", hr); + SysFreeString(language); + script_str = a2bstr("Set var1 = 1"); + V_VT(&var) = VT_EMPTY; + V_I4(&var) = 0xdeadbeef; + hr = IScriptControl_Eval(sc, script_str, &var); + todo_wine ok(hr == 0x800a03ea, "IScriptControl_Eval returned: 0x%08x.\n", hr); + ok(V_VT(&var) == VT_EMPTY, "V_VT(var) = %d\n", V_VT(&var)); + ok(V_I4(&var) == 0xdeadbeef || broken(V_I4(&var) == 0) /* after Win8 */, + "V_I4(var) = %d.\n", V_I4(&var)); + SysFreeString(script_str);
What's a point of this test?
Just want to put a different script language into the controller before the jscript one. And then I found this code line didn't return E_FAIL simply.