COMCreate            package:RDCOMClient            R Documentation

_C_r_e_a_t_e _a _C_O_M _o_b_j_e_c_t

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

     These functions are used from R to either create a COM object of a
     specific type or to obtain a reference to an existing COM
     application/object.

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

     COMCreate(name, ..., existing = TRUE)
     getCOMInstance(guid, force = TRUE, silent = FALSE)

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

    name: the name identifying the type of COM object. This is usually
          the name of the class, such as Excel.Application.  In the
          future, this may support finding class IDs separately and
          passing them as this argument

     ...: currently ignored. In the future,  we will have arguments
          controlling how the server is created, e.g. the location of
          the machine, etc.

    guid: a string (character vector of length 1) that identifies the 
          GUID - Global Unique Identifier - for the COM interface of
          interest. This should have the curly braces ('{...}').

existing: a logical value. If this is 'TRUE', then first we try to 
          connect to an existing instance of the specified DCOM server,
          If no such instance exists, then we create a new one. If this
          is 'FALSE', then we just create a new instance and don't
          check whether there is one already running. This guarantees
          that we get 

   force: a logical value. If this is 'TRUE', this will (attempt to)
          create a new instance of the specified DCOM application if
          there is no instance already in existence. In other words,
          'getCOMInstance' will look for an existing instance and if
          that fails, it will create a new one. If this is 'FALSE',
          'getCOMInstance' will return after attempting to find an
          existing instance. As a result, the return value might be
          'NULL'.

  silent: a logical value that is used when 'force' is 'TRUE' and a new
          object needs to be created. If this is 'TRUE', the warning
          message about creating the new instance is supressed.
          Otherwise, the warning is issued.

_D_e_t_a_i_l_s:

     This resolves the class ID given the name and then creates the
     instance using 'CoCreateInstance'. The class ID is found using
     'CLSIDFromString' and if that fails using 'CLSIDFromProgID'.

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

     An object of class 'COMIDispatch'.

_N_o_t_e:

     'getCOMInstance' works with Word and Excel but for some reason on
     at least some machines fails to find an existing Internet Explorer
     application. As a result, it will create a new instance of the
     application.

_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:

     The '$' and '[[' operators for the 'COMIDispatch' class -
     'COMAccessors'.

     Also, see how one can generate "compiled" or processed interfaces
     to any or all of the types in an application using the
     'SWinTypeLibs'.

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

     ## Not run: 
      COMCreate("Excel.Application")
      getCOMInstance("{000208D5-0000-0000-C000-000000000046}")
     ## End(Not run)

