getElements: General mechanism for retrieving elements of a Type Library...

getElementsR Documentation

General mechanism for retrieving elements of a Type Library element

Description

getElements is a function that serves as a general convenient way to extract the "relevant" elements from a type library or an element within a type library. For a type library, the relevant elements are descriptions of all the classes in the form of a list of ITypeInfo-class. When applied to one of these ITypeInfo-class itself, getElements accesses the sub-elements such as the methods and property accessors for a ITypeInfoDispatch-class object, or the collection of ITypeInfoDispatch-class for a ITypeInfoCoClass-class object. If the object is an enumeration (ITypeInfoEnum-class), this function returns the collection of associated named constants.

getEnum is the actual function that processes ITypeInfoEnum-class elements within a type library to get the "elements". getFuncs is used for ITypeInfoDispatch-class library elements.

Usage

getElements(x, recursive = FALSE)
getEnum(x)

Arguments

x

an object of class ITypeInfo-class

recursive

a logical value

Value

getElements returns a list. Depending on the type of the ITypeInfo-class, different information is returned.

getEnum returns a named integer vector. The names of the vector's elements give the symbolic names of the constants as used in the C/C++ code. These are more readable and more robust than using separate values. The values are the values of the symbolic constants used in the C/C++ code. See EnumValue.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://msdn.microsoft.com/library http://www.omegahat.org/SWinTypeLibs

See Also

getFuncs LoadTypeLib

Examples

## Not run: 
  e = getCOMInstance("Excel.Application")
  lib = LoadTypeLib(e)

  # CoClass
  getElements(lib[["Application"]])

  # Methods of an IDispatch type
  getElements(lib[["_Application"]])
  #  Same thing.
  getFuncs(lib[["_Application"]])

  # Enumeration.
  getElements(lib[["Constants"]])
  getEnum(lib[["Constants"]])

## End(Not run)

omegahat/SWinTypeLibs documentation built on Jan. 17, 2024, 6:40 p.m.