COM connection point

O

Oy Politics

Hello:

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\policy.py", line 283,
in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\PYTHON23\Lib\site-packages\win32com\server\policy.py", line 288,
in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
File "C:\PYTHON23\Lib\site-packages\win32com\server\policy.py", line 581,
in _invokeex_
return func(*args)
File "E:\otsl\testprojects_folder\pythoncom\pyclihh2.py", line 26, in
OnMyEvent
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,
-OY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top