Skip to main content
IGlobalInterfaceTable::RegisterInterfaceInGlobal method

Registers the specified interface on an object residing in one apartment of a process as a global interface, enabling other apartments access to that interface.


HRESULT RegisterInterfaceInGlobal(
  [in]  IUnknown *pUnk,
  [in]  REFIID   riid,
  [out] DWORD    *pdwCookie


pUnk [in]

An interface pointer of type riid on the object on which the interface to be registered as global is implemented.

riid [in]

The IID of the interface to be registered as global.

pdwCookie [out]

An identifier that can be used by another apartment to get access to a pointer to the interface being registered. The value of an invalid cookie is 0.

Return value

This method can return the following values.

Return codeDescription

The method completed successfully.


One or more parameters are invalid.



Called in the apartment in which an object resides to register one of the object's interfaces as a global 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.

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, in another process, or on another computer.

The apartment that calls this method must remain alive until the corresponding call to RevokeInterfaceFromGlobal.


Minimum supported client

Windows 2000 Professional [desktop apps | UWP apps]

Minimum supported server

Windows 2000 Server [desktop apps | UWP apps]






IID_IGlobalInterfaceTable is defined as 00000146-0000-0000-C000-000000000046

See also