COM connection point

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oy Politics

    #1

    COM connection point

    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\Li b\site-packages\win32c om\server\polic y.py", line 283,
    in _Invoke_
    return self._invoke_(d ispid, lcid, wFlags, args)
    File "C:\PYTHON23\Li b\site-packages\win32c om\server\polic y.py", line 288,
    in _invoke_
    return S_OK, -1, self._invokeex_ (dispid, lcid, wFlags, args, None, None)
    File "C:\PYTHON23\Li b\site-packages\win32c om\server\polic y.py", line 581,
    in _invokeex_
    return func(*args)
    File "E:\otsl\testpr ojects_folder\p ythoncom\pyclih h2.py", line 26, in
    OnMyEvent
    print "event!", obj, obj.AProp
    exceptions.Attr ibuteError: 'PyIDispatch' object has no attribute 'AProp'

    "QueryInterface " with the target IID gives the following:

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

    "CastTo" gives this error:

    exceptions.Valu eError: This object can not be cast

    Thanks a lot,
    -OY




Working...