-
Notifications
You must be signed in to change notification settings - Fork 576
Description
Suggestion
Consider the function IActiveScript::GetScriptSite
:
HRESULT GetScriptSite(
REFIID iid, // interface identifier
void **ppvSiteObject // address of host site interface
);
The natural way to implement this function is, given some variable site
, site.QueryInterface(iid, ppvSiteObject)
. And the function is (by my understanding) designed to make that the natural way, as the IActiveScriptSite
is provided via a parallel SetScriptSite
function and the implementor of GetScriptSite
doesn't necessarily know all the interfaces it implements, and therefore all the interfaces the caller of GetScriptSite
might be wanting.
However windows
does not allow you to call QueryInterface
directly. This means I can't implement it that way, and can only cast to interfaces I do know about. If the caller wants IActiveScriptSiteTraceInfo
, and I forgot to include it, then the function fails, where a C implementation would not have to fail.
The generic wrappers around QueryInterface
to encapsulate its quirks are great, but it would be good to be able to call it directly when you need to.