generateInterface        package:SWinTypeLibs        R Documentation

_G_e_n_e_r_a_t_e _S _c_o_d_e _t_o _i_n_t_e_r_f_a_c_e _t_o _c_l_a_s_s_e_s _i_n _a _D_C_O_M _l_i_b_r_a_r_y.

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

     lib: the ITypeLib object containing all the DCOM class
          descriptions. This is typically obtained via a call to
          'LoadTypeLib',  either loading a type library file directly
          or from a COMIDispatch object which is an existing instance
          of a DCOM object. 

 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 'TRUE' indicates to process all the
          co-classes in the library, and if 'FALSE' to ignore them. A
          character vector names the co-class elements in the library
          that should be processed. And a list provides those elements
          explicitly. 

  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'.)

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 'TRUE' indicating that output reporting
          progress and the current activity should be displayed on the
          console.

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 'TRUE',
          'RCOMTypeLibraryInterfaceDefinition-class'  objects are
          defined for each of the referenced libraries and interface 
          descriptions generated  for each of the  referenced types
          within them.

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. 

_V_a_l_u_e:

     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.

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/SWinTypeLibs>

_S_e_e _A_l_s_o:

     'writeCode'

_E_x_a_m_p_l_e_s:

     ## Not run: 
      lib = LoadTypeLib("C:/Microsoft Office/OFFICE11/Excel.EXE")
      def = generateInterface(lib)
      writeCode(def, "Excel.S")
     ## End(Not run)

