.COM {RDCOMClient}R Documentation

Full access to client COM invocation

Description

This is the S function that provides full access to the C routines that perform the invocation of methods in COM servers. This allows one to control the specification of the dispatch method, whether the result is returned.

Usage

.COM(obj, name, ..., .dispatch = as.integer(3), .return = FALSE, .ids = numeric(0))

Arguments

obj the COM object reference, usually obtained via COMCreate.
name the name of the method or property to be accessed.
... arguments to be passed to the method. If names are provided for these arguments, these are used as the names in the COM call. (Not yet!)
.dispatch one or more of the DispatchMethods values indicating the target of the invocation: a method or a property, and whether to get or set the property. In some cases, one wants to specify both a method and a property which is done by OR'ing the values in DispatchMethods in the bit-wise sense of OR'ing.
.return a logical value indicating whether to bother returning the result of the call. This can be used to discard the result of the invocation when only the side-effect is of interest.
.ids an optional numeric vector which, if given, provides the MEMBERID values which identify the names of the method and parameters used in the call. Supplying these avoids the need for an extra communication step with the COM object to map the names to identifiers. One must compute these values using the type library (see getNameIDs) or via other type information gathered from the object or another type library tool, e.g. oleviewer, Visual Basic Editor's type brower.

Value

An arbitrary value obtained from converting the value returned from the COM invocation.

Note

We have madee PROPERTYGET|METHOD the default for method invocation. In this case, this function would become less commonly used.

Also, we will add code to handle the DispatchMethods enumeration symbollically in the same we have for Gtk enumerations in RGtk.

Author(s)

Duncan Temple Lang (duncan@research.bell-labs.com)

References

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

See Also

COMCreate COMAccessors getNameIDs

Examples


 e <- COMCreate("Excel.Application")
 books <- e[["Workbooks"]]
 books$Add()
 
  # Now for the example!
 books$Item(1)

 sheets <- e[["Sheets"]]
 sheets$Item(1)
 sheets$Item("Sheet1")

# Now tidy up.
 e$Quit()
 rm(list = c("books", "e", "sheets"))
 gc()

## Not run: 
o = COMCreate("Excel.Application")

.COM(o, "Count", .dispatch = 2, .ids = id)
## End(Not run)

[Package RDCOMClient version 0.8-1 Index]