generateInterface | R Documentation |
This is the top-level entry point for generating S code
(classes and accessor methods) for interfacing to
DCOM classes described in a type library.
Perhaps it should be called generateTypeLibInterface
.
It processes all of the "dispatch" interfaces described
in the library (or just those specified in the classes
argument) and generates an S4 object describing the interface
to that class and its properties and methods.
generateInterface(lib, classes = names(lib), events = TRUE,
enums = TRUE, coclass = TRUE,
defaultClass = "CompiledCOMIDispatch",
defaultListClass = c("COMList", "COMTypedList"),
class = "RCOMTypeLibraryInterfaceDefinition",
verbose = FALSE, processExternalClasses = TRUE,
computeReferencedClasses = TRUE)
lib |
the ITypeLib object containing all the DCOM class descriptions.
This is typically obtained via a call to |
classes |
a character or integer vector giving the identities of the subset of elements in the type library that are to be processed. This allows callers to generate interfaces to a smaller set of the DCOM classes, as some may not be relevant. |
coclass |
either a logical value, a character vector or a list.
If this is a logical, the value |
events |
a logical value indicating whether to generate interfaces to the event interfaces in the type library. |
enums |
a logical value indicating whether to generate interfaces to the enumerations defined in the type library. |
defaultClass |
a character vector of length 1 (i.e. a string) giving the name
of the S4 class which is to act as the base class for all of the newly generated
classes. (This does not apply to DCOM classes that are lists. See |
defaultListClass |
a string giving the name of the base class to use for DCOM classes that are identified as lists. This is typically COMList, but can be specified differently in order to, for example, handle lists that use zero-based counting (e.g. the links in the Internet Explorer type library). |
class |
a string giving the name of the class to create to represent the information. This is the class of the return value from this function. |
verbose |
a logical value, with |
processExternalClasses |
a logical value indicating whether to
generate interfaces to any DCOM types that are referenced as
types for parameters or return values that are not actually
defined within the type library being processed, but rather
another library on which this one depends. If this is |
computeReferencedClasses |
a logical indicating whether to find all the types that are referenced in parameters, return types, properties, etc. and include those in the result. These are needed for a complete interface to the specified classes, methods and properties. |
An object of class given by the class
argument.
This is instantiated with a single field which are the
descriptions of each of the elements.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
http://www.omegahat.org/SWinTypeLibs
writeCode
## Not run:
lib = LoadTypeLib("C:/Microsoft Office/OFFICE11/Excel.EXE")
def = generateInterface(lib)
writeCode(def, "Excel.S")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.