procedure InterfaceConnect(const Source: IUnknown; const IID: TIID; const Sink: IUnknown; var Connection: Longint);
extern DELPHI_PACKAGE void __fastcall InterfaceConnect(const System::_di_IInterface Source, const GUID &IID, const System::_di_IInterface Sink, int &Connection);
Connects an IConnectionPoint interface.
Call InterfaceConnect from a client application to register an object that implements an outgoing server connection. Typically, this object is an event sink that a client uses to respond to server events. When an event occurs, the server (event source) calls its outgoing interface for the event, and the client, which implements the interface as an event sink, receives the call
InterfaceConnect obtains an IConnectionPoint interface from a COM server advising on a particular connection point. IConnectionPoint lets the server expose an outgoing interface for an object, typically an event sink. IConnectionPointContainer enumerates the connection points supported by the server, so that a caller can find the right connection point. The IConnectionPointContainer and IConnectionPoint interfaces comprise the standard COM event-handling mechanism.
Source is an IUnknown interface for the server object that defines and calls the outgoing interface.
IID is the GUID of the outgoing interface.
Sink is the IUnknown interface of the client object that implements the outgoing interface.
Connection returns a token that represents the connection. It must be saved for use by the InterfaceDisconnect procedure that is called to terminate the connection established by calling InterfaceConnect.
Note: A demo containing this procedure resides in Demos/ActiveX directory.