connectConnectionPoint {RDCOMEvents}R Documentation

Register/Unregister COM Event Handler

Description

These functions associate and disassociate a COM server in S to an event source, or connection point in COM-speak. When connected, any events that occur in that event source will cause the associated method in the COM server's interface to be invoked. These COM servers can be implemented entirely within R using the RDCOMServer package.

When one wants to stop receiving notification of events, one can disconnect from the event source. This is done by passing back the handle created when connecting to the event source.

Usage

connectConnectionPoint(point, server)

Arguments

point the event source from which the event notification comes. This is obtained using getConnectionPoints.
server a COM server object, typically created using createCOMObject or createCOMEventServer.

Details

These use the C++-level COM mechanism to communicate with the COM connection point.

Value

connectConnectionPoint returns the handle that identifies the particular connection. This is an opaque value and should never be used.
Disconnecting either returns NULL or raises an error.

Author(s)

Duncan Temple Lang (duncan@wald.ucdavis.edu)

References

http://www.omegahat.org/RDCOMClient http://www.omegahat.org/RDCOMServer http://www.omegahat.org/SWinTypeLibs

See Also

createCOMObject createCOMEventServer LoadTypeLibrary

event.html

Examples

## Not run: 
 e = COMCreate("Excel.Application")
 con = getConnectionPoints(e)[[1]]

 library(RDCOMServer)
 createCOMEventServer(excelLib[["IAppEvents"]], )

 cookie = connectConnectionPoint(con, server)
 
   # Later, stop processing events.
 disconnectConnectionPoint(con, cookie) 
## End(Not run)

[Package RDCOMEvents version 0.3-1 Index]