COMError: Constructor for COM error

View source: R/COMError.S

COMErrorR Documentation

Constructor for COM error

Description

This is an S-level constructor that allows a programmer to return an error from an S function to a C-level routine. One can indicate different types of errors using the different error codes that are available in the S object named .COMErrors.

Usage

COMError(code, description = "", className = "COMError")
getCOMErrorCode(name)

Arguments

code

a name or value of the error code that corresponds to the internal C-level API for Windows errors. These are dynamically computed when the package is loaded and available as an S vector as in the variable .COMErrors

description

text describing the problem.

className

the name of the S3 class used to represent the error. Currently, this is just an S3-style class name.

name

the name of the COM error whose numeric value is to be retrieved.

Value

An S3-style object containing elements for

code

the numeric value of the code

description

the string describing the error

Author(s)

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

References

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

See Also

SCOMIDispatch

Examples

## Not run: 
 COMError("DISP_E_MEMBERNOTFOUND", "No such element 'foo'")

 name <- "foo"
 COMError("DISP_E_MEMBERNOTFOUND", paste("No such element '", name, "'", sep=""))

## End(Not run)

omegahat/RDCOMServer documentation built on July 17, 2022, 7:25 p.m.