EventSinkConnect
f90VB Modules
f90VBDefs, f90VBVariants, f90VBAutomation
Summary
Establishes a connection between an instance of a sink object and an outgoing interface of an Automation object.
Syntax
| subroutine EventSinkConnect | (EventSink, VarObj, EventIID, iRet) |
| integer(POINTER_KIND),intent(in):: | EventSink |
| type(VARIANT),intent(in):: | VarObj |
| type(GUID),intent(in),optional:: | EventIID |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
Arguments
EventSink [Input]
A handle to an event sink object, as returned by function EventSinkCreate.
VarObj [Input]
A variant containing a reference to the IDispatch interface of a running object.
EventIID [Input]
The Interface Identifier (IID) of the outgoing interface to which the connection must be established. If null or omitted, EventSinkConnect will connect to the first outgoing interface listed by the Automation object.
iRet [Output/Optional]
Upon return, iRet contains S_OK or an error code.
Comments
Use EventSinkConnect to establish a connection point between a sink object created with EventSinkCreate and an outgoing interface (i.e. an event interface) of an instantiated Automation object. If the Automation object does not have outgoing interfaces (i.e. the object does not support events), or if the passed EventIID is not supported by the object, EventSinkConnect returns with an error condition in argument iRet.
An instance of a sink object can be connected only to a single outgoing interface at any given time. However, after disconnecting a sink object (with a call to EventSinkDisconnect), the same sink object can be re-connected to another interface.
When a sink object is connected to an outgoing interface, it retrieves a list of all available event functions and their Dispatch Identifiers (DispID). You can get this list by calling subroutine EventSinkEnumEvnts.
Examples
See Example 6.5 (Chapter 6 - User Manual).
Related Topics
| For information about: | See: | |
| Creating an event sink object | EventSinkCreate | |
| Connecting an event sink to a connectable object | EventSinkConnect | |
| Listing events exposed by a connected event sink object | EventSinkEnumEvnts | |