|
ComBrokerRegisterInterface
ComBrokerRegisterInterface registers interface lpInterface for brokering.
Parameters
InterfaceIID
The interface to which the broker is to bind. Both
lpInterface and
lpHandler must support InterfaceIID.
lpHandler's implementation of
InterfaceIID will receive all calls to
lpInterface, excepting AddRef, Release and
QueryInterface which are forwarded to lpHandler.IntfXxxxx respectively.
lpInterface
Pointer to the interface to be brokered. If
lpInterface is already being brokered, this function will fail.
dwInterfaceMethodCount
Defines the total number of methods defined for interface
InterfaceIID.
This includes the total number of methods inherited from parent
interface definitions, for example IWebBrowser2 contains 70 methods,
including those inherited from IWebBrowserApp, IWebBrowser, IDispatch and
IUnknown.
lpHandler
Pointer to the handler responsible for handling brokered interface
calls.
Return Values
| E_NOINTERFACE |
Either
lpInterface or
lpHandler was null. |
| E_INVALIDARG |
Can mean any of the following:
lpInterface is already being brokered
lpHandler is already defined as a
handler for another brokered interface, or
dwInterfaceMethodCount is less than 3,
the minimum allowed method count for any interface (as IUnknown has 3
methods and all interfaces must support IUnknown). |
| E_UNEXPECTED |
An unknown internal error has
occurred. |
| S_OK |
lpInterface was successfully brokered. |
Remarks
After lpInterface has successfully been
brokered, lpHandler is placed in an
inactive, or paused state. It is up to the
interface handler to call
IInterfaceBroker.Resume to activate
brokering.
|
Export Definition
|
|
Delphi
|
function
ComBrokerRegisterInterface(
const InterfaceIID: TGUID;
lpInterface: IUnknown;
dwInterfaceMethodCount: DWORD;
lpHandler: IInterfaceHandler): HResult; |
|