getNameIDs           package:SWinTypeLibs           R Documentation

_C_o_m_p_u_t_e _t_h_e _n_u_m_e_r_i_c _i_d_e_n_t_i_f_i_e_r_s _f_o_r _D_C_O_M (_m_e_t_h_o_d) _n_a_m_e_s.

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

     This function uses the type library to compute the  mapping of
     names, such as method names, to the  numeric identifiers used in
     dispatching a a call using those names. 

     The '.COM' functionality used to invoke a method first sends a
     query to resolve the identifiers for the names in the method call.
     Then it uses these to actually make the call. Therefore,
     precomputing these identifiers   and using them in calls can
     improve the  efficiency of the call by avoiding the first step.

     This information is also used when we implement a DCOM server in
     R. When other clients query the identifier for a name of a method
     in our server's interface, we must respond appropriately. When
     implementing already defined, established interfaces, again
     precomputing the name-identifier map helps.

     This is a generic function that operates on various different
     pairs of input types.

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

     getNameIDs(obj, context)

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

     obj: the object which is to be interrogated for the
          name-identifier mapping.

 context: support information in which some methods will resolve the 
          name-identifier connections. For example,  

_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://msdn.microsoft.com/library> <URL:
     http://www.omegahat.org/RWinTypeLibs>

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

     '.COM' and the 'ids' argument. 'COMInterfaceServerInfo-class' and
     its 'ids' slot.

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

     ## Not run: 

          # FunctionInvokeDescription and an ITypeInfo.
        funcs = getFuncs(lib[["_Application"]])
        getNameIDs(funcs$Quit, lib[["_Application"]])

         # include parameters, although these will come back as 0, 1, ...
        getNameIDs(funcs$GetSaveAsFilename, lib[["_Application"]])

         # Instead of getting the FunctionInvokeDescription object first,
         # let getNameIDs do the work.  Works for arbitrary objects
         # in the ITypeInfo, not just FunctionInvokeDescription objects,
         # but property set and get methods, etc.
        getNameIDs("Quit", lib[["_Application"]])

         # Get the name mappings for all the elements of an ITypeInfo,
         # e.g. all functions all at once.
        getNameIDs(lib[["_Application"]])   
     ## End(Not run)

