[New for Windows NT 4.0 Service Pack 3.]
Supplies a pointer to an interface on an object registered in the global table that is usable by the calling apartment.
HRESULT GetInterfaceFromGlobal(
DWORD dwCookie, //Cookie identifying the desired global
//interface and its object
REFIID riid, //IID of the registered global interface
void **ppv //Indirect pointer to the desired interface
);
An apartment that wants a pointer to this interface then calls the GetInterfaceFromGlobal method with this cookie, and the implementation then, in the proper way, supplies a pointer to the interface that can be used in the calling apartment. The interface pointer supplied cannot be used by other apartments in the process.
The application is responsible for coordinating access to the global variable during calls to RevokeInterfaceFromGlobal. That is, the application should ensure that one thread does not call RevokeInterfaceFromGlobal while another thread is calling GetInterfaceFromGlobal with the same cookie. Multiple calls to GetInterfaceFromGlobal for the same cookie are permitted.'
GetInterfaceFromGlobal calls IUnknown::AddRef on the pointer obtained in ppv. It is the caller's responsibility to call Release on this pointer.
Windows NT: Use version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IGlobalInterfaceTable::RegisterInterfaceInGlobal, IGlobalInterfaceTable::RevokeInterfaceFromGlobal