Nikolay Sivov (@nsivov) commented about dlls/wshom.ocx/tests/wshom.c:
check_interface(disp, &IID_IDispatchEx, FALSE); check_interface(disp, &IID_IObjectWithSite, FALSE);
- str = NULL;
- hr = IWshNetwork2_get_UserName((IWshNetwork2*)disp, &str);
- ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
Yes, it's better not to do that. Query for interface you need, or request it in first place when creating an object.