queryTypeLibPath: Find the full path of the associated type library.

queryTypeLibPathR Documentation

Find the full path of the associated type library.

Description

This function (and its methods) can locate the full name of the file that is the type library associated with an appropriate object in R. It can be used on DCOM objects (of class COMIDispatch), ITypeInfo objects derived from a DCOM object or from a type library, or from a type library itself. Additionally, it can also be called with the UUID (specifically the GUID) identifying a class/interface and it consults the Windows' registry to find the associated type library. It is a convenient way to find the actual file itself from an instance of a DCOM object, so that it can be loaded directly in other sessions without having to create the DCOM object first.

Usage

queryTypeLibPath(guid, version, lcid = 0)

Arguments

guid

the object identifying the type library. This can be a COMIDispatch-class, or link{ITypeInfo}, or a UUID or character string giving the UUID.

version

if specified, an integer vector of length 2 giving the major and minor version numbers (in that order) of the library of interest.

lcid

a numeric value giving the locale identifier to identify the particular version of the library of interest. The default works well.

Value

A character vector or an error. The character vector is the full name of the file identifying the type library for the given object.

Author(s)

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

References

http://www.omegahat.org/SWinTypeLibs

See Also

LoadTypeLib

Examples

## Not run: 
  library(RDCOMClient)
  e = COMCreate("Excel.Application")
  fileName = queryTypeLibPath(e)

  lib1 = LoadTypeLib(fileName)
  lib2 = LoadTypeLib(e)
  # lib1 and lib2 should be the same.

## End(Not run)

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