RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ComObj.InterfaceConnect Function

Connects an IConnectionPoint interface.

Pascal
procedure InterfaceConnect(const Source: IUnknown; const IID: TIID; const Sink: IUnknown; var Connection: Longint);
C++
InterfaceConnect(const IUnknown Source, const TIID IID, const IUnknown Sink, Longint Connection);

ComObj

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.
 

 

InterfaceDisconnect 

Handling Events in an Automation Controller

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!