connectConnectionPoint {RDCOMEvents} | R Documentation |
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.
connectConnectionPoint(point, server)
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 . |
These use the C++-level COM mechanism to communicate with the COM connection point.
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.
Duncan Temple Lang (duncan@wald.ucdavis.edu)
http://www.omegahat.org/RDCOMClient http://www.omegahat.org/RDCOMServer http://www.omegahat.org/SWinTypeLibs
createCOMObject
createCOMEventServer
LoadTypeLibrary
## 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)