Get all attributes of a com object

eicwo01 wolfgang.eichler at ca.com
Fri Apr 28 03:34:49 EDT 2006


Thanks for your tips.
But dir() and inspect did not really help.

dir():
['GetIDsOfNames', 'GetTypeInfo', 'GetTypeInfoCount', 'Invoke',
'InvokeTypes', 'QueryInterface', '_ApplyTypes_', '_FlagAsMethod',
'_LazyAddAttr_', '_NewEnum', '_Release_', '__AttrToID__',
'__LazyMap__', '__call__', '__cmp__', '__doc__', '__getattr__',
'__getitem__', '__init__', '__int__', '__len__', '__module__',
'__nonzero__', '__repr__', '__setattr__', '__setitem__', '__str__',
'_builtMethods_', '_enum_', '_find_dispatch_type_',
'_get_good_object_', '_get_good_single_object_', '_lazydata_',
'_make_method_', '_mapCachedItems_', '_oleobj_', '_olerepr_',
'_print_details_', '_proc_', '_unicode_to_string_', '_username_',
'_wrap_dispatch_']

pprint.pprint(inspect.getmembers(objDom)):
[('GetIDsOfNames',
  <built-in method GetIDsOfNames of PyIDispatch object at 0x00AB7BFC>),
 ('GetTypeInfo',
  <built-in method GetTypeInfo of PyIDispatch object at 0x00AB7BFC>),
 ('GetTypeInfoCount',
  <built-in method GetTypeInfoCount of PyIDispatch object at
0x00AB7BFC>),
 ('Invoke', <built-in method Invoke of PyIDispatch object at
0x00AB7BFC>),
 ('InvokeTypes',
  <built-in method InvokeTypes of PyIDispatch object at 0x00AB7BFC>),
 ('QueryInterface',
  <bound method ADSIDispatch.QueryInterface of <COMObject Dispatch
wrapper around <PyIDispatch at 0xab7bfc with obj at 0x2625c8>>>),
 ('_ApplyTypes_',
  <bound method ADSIDispatch._ApplyTypes_ of <COMObject Dispatch
wrapper around <PyIDispatch at 0xab7bfc with obj at 0x2625c8>>>),
 ...
Further more this nice method also did not know any more:
objDom._print_details_():

AxDispatch container Dispatch wrapper around <PyIDispatch at 0xab7bfc
with obj at 0x2625c8>
Methods:
Props:
Get Props:
Put Props:

Any additional hint  ?
Could it be, that you must know in advance, what to ask a com object;
so there is no dump possibility ?

Thanks
Wolfgang




More information about the Python-list mailing list