COM support (was Re: Can Python replace Visual Basic? Should it?)

Alex Martelli aleaxit at yahoo.com
Fri Mar 9 10:05:08 EST 2001


"Steve Holden" <sholden at holdenweb.com> wrote in message
news:fU5q6.45262$1D5.2046670 at e420r-atl1.usenetserver.com...
    [snip -- sorry but I didn't see the post Steve is
     responding to, so I'm taking advantage to reply...]
> > interface classes and things like that and this is one point Visual
Basic
> > handles nicely.

...until you smack into something really hard-to-handle, and then you're
on a rudderless raft in the middle of the ocean.  Which doesn't happen
with C++... or Python.

> > ActiveX control containment is also one thing I would have
> > no idea on how to start.

Instantiate a WebBrowser (an instance of the Internet Explorer
core functionality, minus toolbars, menus, etc), and that will
easily supply all the active-document (and active-control)
containment functionality you might ever possibly desire, _and
then some_.  A tiny amount of HTML and a modest amount of COM
let you do WONDERS with WebBrowser and friends.


>  COM is much more  fun in Python than in VB, until you stub your toe
against
> somethig that really does require an understanding of the underlying
> implementation.

...which happens more rarely in VB, but DOES happen (been there,
done that, got the T-shirt), and when it does you ARE in a truly
desperate situation (which is not the case when you have sources
to your tools -- the situation can then be serious, but never
truly hopeless).  As I mentioned, this is the main thing I'm
currently doing to earn the daily caviar & champagne -- playing
guru on all COM issues (and a few others, such as C++, VB, &c)
in support of a few hundred application developers -- so, of course,
I get _mostly_ exposed to the very difficult problem cases, which
may distort my perception but gives me ample proof of existence
of such cases:-).


> > P.S.: Of course one should (or must, to bring it to the point)
understand
> > the technology in use. This applies heavily to COM, and I know quite a
lot
> > about that stuff. This is one of the reasons I think that well designed
> > interfaces are more important for remoting than the actual programming
> > language. And you can use IDL defined Interfaces with VB, otherwise it
> > would be a headache some time...

I much prefer IDL-described interfaces, too, no matter how they're
going to be implemented and consumed; I consider it a defect of .NET
that it includes no official interface-description language, but
rather appears to assume each programming language will be able to
fully and transparently map any existing or being-designed interface
into its own terms -- a seriously-wrong architecture decision IMHO.


Alex






More information about the Python-list mailing list