.COM               package:RDCOMClient               R Documentation

_F_u_l_l _a_c_c_e_s_s _t_o _c_l_i_e_n_t _C_O_M _i_n_v_o_c_a_t_i_o_n

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

     This is the S function that provides full access to the C routines
     that perform the invocation of methods in COM servers. This allows
     one to control the specification of the dispatch method, whether
     the result is returned.

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

     .COM(obj, name, ..., .dispatch = as.integer(3), .return = TRUE, 
           .ids = numeric(0), .suppliedArgs)

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

     obj: the COM object reference, usually obtained via 'COMCreate'.

    name: the name of the method or property to be accessed.

     ...: arguments to be passed to the method. If names are provided
          for these arguments, these are used as the names in the COM
          call. (Not yet!)

.dispatch: one or more of the 'DispatchMethods' values indicating the
          target of the invocation: a method or a property, and whether
          to get or set the property. In some cases, one wants to
          specify both a method and a property which is done by OR'ing
          the values in 'DispatchMethods' in the bit-wise sense of
          OR'ing. 

 .return: a logical value indicating whether to bother returning the
          result of the call. This can be used to discard the result of
          the invocation when only the side-effect is of interest. 

    .ids: an optional numeric vector which, if given,  provides the
          'MEMBERID' values which identify the names of the method and
          parameters used in the call. Supplying these avoids the need
          for an extra communication step with the COM object to map
          the names to identifiers. One must compute these values using
          the type library (see 'getNameIDs') or  via other type
          information gathered from the object or  another type library
          tool, e.g. oleviewer, Visual Basic Editor's type brower. 

.suppliedArgs: a logical vector indicating which of the arguments
          provided by ... are to be used. In general, this argument is
          not used in interactive use. However, when the code calling
          the '.COM' function is generated, this provides a way to
          specify which are actual arguments and which are default
          values for arguments.

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

     An arbitrary value obtained from converting the value returned
     from the COM invocation.

_N_o_t_e:

     We have madee PROPERTYGET|METHOD the default for method
     invocation. In this case, this  function would become less
     commonly used.

     Also, we will add code to handle the DispatchMethods enumeration
     symbollically in the same we have for Gtk enumerations in  RGtk.

_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/RDCOMClient> <URL:
     http://www.omegahat.org/RDCOMServer> <URL:
     http://www.omegahat.org/SWinTypeLibs> <URL:
     http://www.omegahat.org/SWinRegistry>

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

     'COMCreate' 'COMAccessors' 'getNameIDs'

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

      e <- COMCreate("Excel.Application")
      books <- e[["Workbooks"]]
      books$Add()
      
       # Now for the example!
      books$Item(1)

      sheets <- e[["Sheets"]]
      sheets$Item(1)
     ## Not run: 
       # We can index the list of sheets by sheet name.
       # This is not run here as the name is different for 
       # different languages.  
      sheets$Item("Sheet1")
     ## End(Not run)

     # Now tidy up.
      e$Quit()
      rm(list = c("books", "e", "sheets"))
      gc()

     ## Not run: 
     o = COMCreate("Excel.Application")

     .COM(o, "Count", .dispatch = 2, .ids = id)
     ## End(Not run)

