win32com:MakePy -- Early Binding without the size jitters?

Clark C. Evans cce at clarkevans.com
Mon Mar 26 05:18:47 EST 2001


On Mon, 26 Mar 2001, Clark C. Evans wrote:
> 
>       doc = msxml.DOMDocument.default_interface(
>                 pythoncom.CoCreateInstance( 
>                     "MSXML2.DOMDocument",None, 
>                      pythoncom.CLSCTX_INPROC,
>                      pythoncom.IID_IDispatch))
> 
...

>    import msxml3
>    doc = msxml3.DOMDocument()

*blush*   I was working too hard, as the following is all I need:

  msxml.DOMDocument.default_interface(msxml.DOMDocument())

I was wondering if the wrapper generator could be fixed
to do this automatically?   For some reason, the __init__
below isn't doing it... go figure.

   class CoClassBaseClass:
       def __init__(self, oobj=None):
          if oobj is None: oobj = pythoncom.new(self.CLSID)
          self.__dict__["_dispobj_"] = self.default_interface(oobj)

...

Anyway, thank you for such an Excelent product!  Wow!  I can 
finally *DITCH* Visual Basic for "object scripting" ... I think.

Kind Regards,

;) Clark







More information about the Python-list mailing list