https://bugs.winehq.org/show_bug.cgi?id=53868
Bug ID: 53868 Summary: vbscript fails to return TypeName for VT_DISPATCH Product: Wine Version: 7.20 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
I ran into some vbscript where it was trying to get the TypeName of an object:
Private Sub RemoveBall(aBall) dim x : for x = 0 to uBound(balls) if TypeName(balls(x) ) = "IBall" then if aBall.ID = Balls(x).ID Then balls(x) = Empty Balldata(x).Reset End If End If Next End Sub
I was able to work around this by added a VT_DISPATCH case to Global_TypeName and fetching it from ITypeInfo_GetDocumentation:
case VT_DISPATCH: { ITypeInfo* typeinfo; HRESULT hres = IDispatch_GetTypeInfo(V_DISPATCH(arg), 0, 0, &typeinfo); if(FAILED(hres)) { return E_FAIL; } BSTR name; hres = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &name, NULL, NULL, NULL); if(FAILED(hres)) { return E_FAIL; } hres = return_string(res, name); SysFreeString(name); return hres; }