[New for Windows NT 4.0 Service Pack 3.]
Registers a specified interface on an object residing in one apartment of a process as a "global" (process-wide) interface, allowing other apartments access to that interface.
HRESULT RegisterInterfaceInGlobal(
IUnknown *pUnk, //Pointer to interface of type riid of object
//containing global interface
REFIID riid, //IID of the interface to be registered
DWORD *pdwCookie //Supplies a pointer to the cookie that provides
//a caller in another apartment access to the
//interface pointer
);
Called by the apartment in which an object resides to register one of the interfaces implemented on it as a "global" (process-wide) interface. This method supplies a pointer to a cookie that other apartments can use in a call to the GetInterfaceFromGlobal method to get a pointer to that interface. This is a very efficient way to do this operation.
The interface pointer may be a pointer to an in-process object, or it may be a pointer to a proxy for an object residing in another apartment, another process, or another machine.
The apartment that calls this method must remain alive until the corresponding call to RevokeInterfaceFromGlobal is called.
Because this method is not available on Windows95 or versions of Windows NT earlier than version 4.0, Service Pack 3, apartments should call CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream to marshal the pointers on failure of this method.
Windows NT: Use version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in objidl.h.
IGlobalInterfaceTable::RevokeInterfaceFromGlobal, IGlobalInterfaceTable::GetInterfaceFromGlobal