Problem setting COM property using win32com

Green, Gregory P gregory.p.green at boeing.com
Mon Apr 7 21:54:17 CEST 2003


I don't think the gen_py class is being used:

print obj: <COMObject SmRecList.SmRecordList>

print obj.__class__: win32com.client.CDispatch

print dir(obj): ['_ApplyTypes_', '_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_']


-----Original Message-----
From: Paul Prescod [mailto:paul at prescod.net]
Sent: Monday, April 07, 2003 11:39 AM
To: Green, Gregory P; python-list at python.org
Subject: Re: Problem setting COM property using win32com


Green, Gregory P wrote:
> I am creating the object like so:
> 
>    attrs = win32com.client.Dispatch("SmRecList.SmRecordList")
> 
> I hadn't noticed the dynamic. I guess I can try to force early binding.

Do some introspection on the objects to see whether they are makepy 
objects or dynamic objects. Probably if you print out the __class__ or 
dir() of the objects you'll get a strong hint.

  Paul Prescod






More information about the Python-list mailing list