Python COM troubles

Mark Hammond mhammond at skippinet.com.au
Fri Apr 28 19:09:14 EDT 2000


"William Wicker" <remove.me.wwicker at spectratechnologies.com> wrote in
message news:390acf5e.62946872 at news.onlineisp.com...
> On Thu, 27 Apr 2000 00:46:35 GMT, "Mark Hammond"
> <mhammond at skippinet.com.au> wrote:
>
> >"William Wicker" <remove.me.wwicker at spectratechnologies.com> wrote in
> >message news:390a2f04.149999918 at news.onlineisp.com...

> >[BTW - drop them a line, and tell them they should fix their objects
:-]
> >
>
> Can you fill me in with what in particular I should complain about?
> Comments that RTTI was lacking brought the response that
> QueryInterface was supported.

Their IDispatch implementation should implement GetTypeInfo() - it should
be quite trivial to do, as they already have the type info available, it
just isnt connected to the objects at runtime.

> Also, (did I already ask this?) I'm guessing that using the
> EnsureModule approach will make DispatchWithEvents unavailable.
> Reading dynamic.py suggests that there is an alternate (more complex?)
> way.

It _should_ work - but instead of passing a CLSID, pass the object
itself - eg, instead of passing:

ob = DispatchWithEvents("Foo.Bar", your_class)

use:
mod = gencache.EnsureModule(...)
ob = mod.FooBar() # To work around the lack of type info.
ob = DispatchWithEvents(ob, your_class)

Mark.






More information about the Python-list mailing list