By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,402 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,402 IT Pros & Developers. It's quick & easy.

COM connection point

P: n/a

I am building a COM client, with the ability to be called back by events.
The events can arrive independently from the server. The client method is
called at the right time, so that is working. However, one parameter is
itself a COM object, and I am having trouble with accessing the properties
of the parameter object.

Here is the output of what I have currently.

---------- Python execute ----------
event! <PyIDispatch at 0x7fb134 with obj at 0x403404>
event! <PyIDispatch at 0x7fbbf4 with obj at 0x403404>
event! <PyIDispatch at 0x7a6d24 with obj at 0x403404>

etc. Obj is supposed to be my intended parameter. However, when I try to
access its property, I get the following:

---------- Python execute ----------
pythoncom error: Python error invoking COM method.

Traceback (most recent call last):
File "C:\PYTHON23\Lib\site-packages\win32com\server\", line 283,
in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\PYTHON23\Lib\site-packages\win32com\server\", line 288,
in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
File "C:\PYTHON23\Lib\site-packages\win32com\server\", line 581,
in _invokeex_
return func(*args)
File "E:\otsl\testprojects_folder\pythoncom\ ", line 26, in
print "event!", obj, obj.AProp
exceptions.AttributeError: 'PyIDispatch' object has no attribute 'AProp'

"QueryInterface" with the target IID gives the following:

exceptions.TypeError: There is no interface object registered that supports
this IID

"CastTo" gives this error:

exceptions.ValueError: This object can not be cast

Thanks a lot,

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.