python com wrappers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Rudin

    python com wrappers


    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 DispatchWithEve nts or WithEvents -
    e.g. "com_error: (-2147220992, 'CONNECT_E_NOCO NNECTION', 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
    DispatchBaseCla ss 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

    #2
    Re: python com wrappers

    >>>>> "Paul" == Paul Rudin <paul_rudin@sci entia.com> writes:
    [color=blue]
    > I'm having a problem with the python wrappers generated from a
    > type library.[/color]
    [color=blue]
    > The symptom is that I get failures to find connections points
    > inside the wrappers when called from DispatchWithEve nts or
    > WithEvents - e.g. "com_error: (-2147220992,
    > 'CONNECT_E_NOCO NNECTION', None, None)"[/color]
    [color=blue]
    > 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 DispatchBaseCla ss subclasses via the coclass_clsid
    > property, whereas probably what should happen is that only ones
    > that are default should be so treated.[/color]
    [color=blue]
    > But maybe I'm misdiagnosing the problem; has anyone else seen
    > this and/or know what the problem is?[/color]

    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_CoClassC hildren. Replacing the line:

    dispItem.coclas s_clsid = coclass.clsid

    with the lines:

    if flags & pythoncom.IMPLT YPEFLAG_FDEFAUL T:
    dispItem.coclas s_clsid = coclass.clsid


    seems to solve the problem, although perhaps this breaks something
    else?

    Comment

    • John J. Lee

      #3
      Re: python com wrappers

      Paul Rudin <paul_rudin@sci entia.com> writes:
      [...][color=blue]
      > seems to solve the problem, although perhaps this breaks something
      > else?[/color]

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


      John

      Comment

      • R.Marquez

        #4
        Re: python com wrappers

        jjl@pobox.com (John J. Lee) wrote in message news:<87k756szx h.fsf@pobox.com >...[color=blue]
        > Paul Rudin <paul_rudin@sci entia.com> writes:
        > [...][color=green]
        > > seems to solve the problem, although perhaps this breaks something
        > > else?[/color]
        >
        > Try posting what you just wrote to the python-win32 list.
        >
        >
        > John[/color]

        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.

        Comment

        Working...