vbscript: Added support for SCRIPTITEM_ISVISIBLE named items.

oldstable
Jacek Caban 2011-09-19 14:09:45 +02:00 committed by Alexandre Julliard
parent 347cf1d39d
commit 95d040e99e
2 changed files with 25 additions and 0 deletions

View File

@ -149,6 +149,29 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return S_OK;
}
}
if((item->flags & SCRIPTITEM_ISVISIBLE) && !strcmpiW(item->name, name)) {
if(!item->disp) {
IUnknown *unk;
hres = IActiveScriptSite_GetItemInfo(ctx->script->site, name, SCRIPTINFO_IUNKNOWN, &unk, NULL);
if(FAILED(hres)) {
WARN("GetItemInfo failed: %08x\n", hres);
continue;
}
hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp);
IUnknown_Release(unk);
if(FAILED(hres)) {
WARN("object does not implement IDispatch\n");
continue;
}
}
ref->type = REF_OBJ;
ref->u.obj = item->disp;
return S_OK;
}
}
if(!strcmpiW(name, errW)) {

View File

@ -620,4 +620,6 @@ Call ok(not (x is Nothing), "x is 1")
Call ok(Nothing is Nothing, "Nothing is not Nothing")
Call ok(x is obj and true, "x is obj and true is false")
Call ok(getVT(test) = "VT_DISPATCH", "getVT(test) = " & getVT(test))
reportSuccess()