getElements           package:SWinTypeLibs           R Documentation

_G_e_n_e_r_a_l _m_e_c_h_a_n_i_s_m _f_o_r _r_e_t_r_i_e_v_i_n_g _e_l_e_m_e_n_t_s _o_f _a _T_y_p_e _L_i_b_r_a_r_y _e_l_e_m_e_n_t

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

     'getElements' is a function that serves as a general convenient
     way to extract the "relevant" elements from a type library or an
     element within a type library. For a type library, the relevant
     elements are   descriptions of all the classes in the form of a
     list of 'ITypeInfo-class'. When applied to one of these
     'ITypeInfo-class' itself, 'getElements' accesses the sub-elements
     such as the methods and property accessors for a
     'ITypeInfoDispatch-class' object, or the collection of
     'ITypeInfoDispatch-class' for a 'ITypeInfoCoClass-class' object.
     If the object is an enumeration ('ITypeInfoEnum-class'), this
     function returns the collection of associated named constants.

     'getEnum' is the actual function that processes
     '\class{ITypeInfoEnum-class}' elements within a type library to
     get the "elements". 'getFuncs' is used for 
     '\class{ITypeInfoDispatch-class}' library elements.

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

     getElements(x, recursive = FALSE)
     getEnum(x)

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

       x: an object of class 'ITypeInfo-class'

recursive: a logical value 

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

     'getElements' returns a list. Depending on the type of the
     'ITypeInfo-class',  different information is  returned.

     'getEnum' returns a named integer vector. The names of the
     vector's elements give the symbolic names of the constants as used
     in the C/C++ code. These are more readable and more robust than
     using separate values. The values are the values of the symbolic
     constants used in the C/C++ code. See 'EnumValue'.

_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/SWinTypeLibs>

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

     'getFuncs' 'LoadTypeLib'

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

     ## Not run: 
       e = getCOMInstance("Excel.Application")
       lib = LoadTypeLib(e)

       # CoClass
       getElements(lib[["Application"]])

       # Methods of an IDispatch type
       getElements(lib[["_Application"]])
       #  Same thing.
       getFuncs(lib[["_Application"]])

       # Enumeration.
       getElements(lib[["Constants"]])
       getEnum(lib[["Constants"]])
     ## End(Not run)

