python com wrappers

Discussion in 'Python' started by Paul Rudin, Dec 9, 2003.

  1. Paul Rudin

    Paul Rudin Guest

    I'm having a problem with the python wrappers generated from a type
    library.

    The symptom is that I get failures to find connections points inside
    the wrappers when called from DispatchWithEvents or WithEvents -
    e.g. "com_error: (-2147220992, 'CONNECT_E_NOCONNECTION', None, None)"

    It seems that the coclass_clsid property of some classes is
    incorrect. It seems that when a coclass in the type library has
    multiple "[source] dispinterface" it can happen that this coclass can
    end up as the one referenced by each of the corresponding
    DispatchBaseClass subclasses via the coclass_clsid property, whereas
    probably what should happen is that only ones that are default should
    be so treated.

    But maybe I'm misdiagnosing the problem; has anyone else seen this
    and/or know what the problem is?
     
    Paul Rudin, Dec 9, 2003
    #1
    1. Advertising

  2. Paul Rudin

    Paul Rudin Guest

    >>>>> "Paul" == Paul Rudin <> writes:

    > I'm having a problem with the python wrappers generated from a
    > type library.


    > The symptom is that I get failures to find connections points
    > inside the wrappers when called from DispatchWithEvents or
    > WithEvents - e.g. "com_error: (-2147220992,
    > 'CONNECT_E_NOCONNECTION', None, None)"


    > It seems that the coclass_clsid property of some classes is
    > incorrect. It seems that when a coclass in the type library has
    > multiple "[source] dispinterface" it can happen that this
    > coclass can end up as the one referenced by each of the
    > corresponding DispatchBaseClass subclasses via the coclass_clsid
    > property, whereas probably what should happen is that only ones
    > that are default should be so treated.


    > But maybe I'm misdiagnosing the problem; has anyone else seen
    > this and/or know what the problem is?


    To test this I had a quick look at the code that generates the
    wrappers. In win32com/client/genpy.py The class Generator has a method
    _Build_CoClassChildren. Replacing the line:

    dispItem.coclass_clsid = coclass.clsid

    with the lines:

    if flags & pythoncom.IMPLTYPEFLAG_FDEFAULT:
    dispItem.coclass_clsid = coclass.clsid


    seems to solve the problem, although perhaps this breaks something
    else?
     
    Paul Rudin, Dec 9, 2003
    #2
    1. Advertising

  3. Paul Rudin

    John J. Lee Guest

    Paul Rudin <> writes:
    [...]
    > seems to solve the problem, although perhaps this breaks something
    > else?


    Try posting what you just wrote to the python-win32 list.


    John
     
    John J. Lee, Dec 9, 2003
    #3
  4. Paul Rudin

    R.Marquez Guest

    (John J. Lee) wrote in message news:<>...
    > Paul Rudin <> writes:
    > [...]
    > > seems to solve the problem, although perhaps this breaks something
    > > else?

    >
    > Try posting what you just wrote to the python-win32 list.
    >
    >
    > John


    John,

    Could you provide a pointer to that list? I know of the Mailing Lists
    at Source Forge, but they are just a bug reporting one and checkins
    one. Thanks.
     
    R.Marquez, Dec 10, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Etienne Posthumus

    Anyone else using Python OpenSSL Wrappers?

    Etienne Posthumus, Jan 12, 2004, in forum: Python
    Replies:
    0
    Views:
    322
    Etienne Posthumus
    Jan 12, 2004
  2. Replies:
    0
    Views:
    268
  3. DreiJane
    Replies:
    0
    Views:
    274
    DreiJane
    Nov 23, 2009
  4. DreiJane
    Replies:
    0
    Views:
    291
    DreiJane
    Nov 23, 2009
  5. DreiJane
    Replies:
    0
    Views:
    250
    DreiJane
    Nov 23, 2009
Loading...

Share This Page