[python-win32] Re: Re: Yet another python-com bridge (wincom.pyd)

Lijun Qin qinlj at solidshare.com
Tue Apr 6 21:56:45 EDT 2004


Hi,

You can try to use:

sofon.project[k]
or
sofon.project.Item(k)

also, if you have typelib, import it first, like this:
tlb = wincom.typelib('{XXXXXXXXXXXXXXXXXXXXX}', Major_type_lib_ver,
Minor_type_lib_ver)

and create the object through it, like this:
obj = tlb.coclass_name()

wincom will works better if it can get the typelib information, otw, it'll
have to guess in some situation, and it can be wrong.

current wincom.pyd does have some missing features, including:
Optional parameters is not supported
pure VTable interface is not supported yet, it must be dual
module and struct object in typelib is not supported

they are not there mainly because they are not needed in my current project,
and in the next 3-6 monthes, I'll have no time to work on this, but normally
you can live without them, I think.

Lijun Qin


"Schneider" <schnijders at home.nl> wrote in message
news:DOEOLMOIEEOCCNPCIBBPMEKECAAA.schnijders at home.nl...
> Hi Lijun,
>
> I started using your com interface today and had both success and
problems.
>
> First of all, the wincom module did not want to load since the MSVCR71.DLL
> and MSVCP71.DLL were missing on my machine. After installing these, some
> probelms I had with win32com (VARIANT* Value parameters) seem to be
solved.
> However, now I run into problems with the system complaining about missing
> parameters.
> In the win32com situation the code
>
>     for k in range(sofon.project.Count):
>         print k
>         pos = sofon.project.Item(k)
>
> worked fine. Now I get the error:
>
> Traceback (most recent call last):
>   File "L:\InvoiceSofon\invoiceSofonMainFrame.py", line 459, in
> OnFilemenuitems2Menu
>     printRec(odbc, sofon, self.invoiceOverviewListCtrl, Index)
>   File "L:\InvoiceSofon\invoiceSofonFunctopns.py", line 162, in printRec
>     pos = sofon.project.Item[k]
> wincom.COMError: hr = 0x8002000f (Parameter niet optioneel. )
>
> The error says 'Parameter not optional.'
>
> Do you have any suggestions??
>
> Frans
>
> -----Oorspronkelijk bericht-----
> Van: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]Namens Lijun Qin
> Verzonden: dinsdag 30 maart 2004 3:24
> Aan: python-win32 at python.org
> Onderwerp: [python-win32] Re: Yet another python-com bridge (wincom.pyd)
>
>
> Sorry, the link is http://www.solidshare.com/python/wincom.zip
>
>
> "Lijun Qin" <qinlj at solidshare.com> wrote in message
> news:008f01c4146c$db3873f0$0200a8c0 at huhu...
> > Hi all,
> >
> > Here is my own python-com bridge (named wincom), which support Python at
> as
> > both server and client side, support C++ access python use vtable
> interface
> > when the interface is a dual interface (similar to universal_gateway
> featuer
> > of win32all).
> > One of the feature of wincom is that there is only a simple pyd file
> > (wincom.pyd, and runtime boost_python23.dll) to deply, unlike win32-all
> > package you'll need deploy a whole package.
> > Another feature of wincom is that it's use is quite simple, a typelib is
> in
> > the center, and all objects in the typelib can be easily imported, like
> > this:
> >
> > import wincom
> > msxml = wincom.typelib('{F5078F18-C551-11D3-89B9-0000F81FE221}', 4, 0)
> >
> > after these lines, all objects in the msxml4.0 typelib can be easily
> > accessed, like this:
> >
> > self.dom = msxml.DOMDocument40()        #create a CoClass use it's name
> > if not self.dom.load(file_name):
> >             raise RuntimeError, "load xml file failed"
> >
> > self.node = self.dom.documentElement        #COM object property mapped
to
> > python attribute
> > self.id = self.node.getAttribute('id')             #COM object function
> > mapped to python method
> >
> > self.my_objs = []
> > for my_obj_node in self.node.selectNodes("//my_obj"):    #COM
enumratable
> > mapped to python iter object
> >     self.my_objs.append(my_obj_class(self, my_obj_node))
> >
> > You can download the file from
> http://www.solidshare.com/python/wincom.pyd,
> > source file is not included, but if peoples like it, I'll consider setup
a
> > project in sourceforge or somewhere else.
> >
> > Lijun Qin
>
>
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32






More information about the Python-win32 mailing list