Kelie schrieb:
> Hello,
> 
> I noticed the argument order in an event handler in comtypes is reversed when
> compared with VB reference. For example:
> 
> Excel's Application object has a WindowResize event and according to the VB
> reference, the syntax is:
> Private Sub object_WindowResize(ByVal Wb As Excel.Workbook, ByVal Wn As
> Excel.Window)
> 
> But in comtypes, the syntax would be:
> def onWindowResize(self, this, Wn, Wb)
> 
> The order of Wn and Wb is reversed. Is this intended? 

No, it is not intended.  However, there is no quick fix for this bug,
since the event handlers on other interfaces (InternetExplorer for example)
are called with the correct argument order.  I suspect there is an obscure flag
on the interface or something like that; I still have to find out.

> Also, what is the argument "this" for?

There is a short and a long answer to that.

The short answer is that the 'this' argument is an implementation detail of 
comtypes
that you receive but can/should ignore: event handlers are really C/C++ 
callable functions
that comtypes implements for you; the 'this' argument is invisible but 
implicitely passed to
these functions.

For a short introduction to the longer answer (which is not yet written 
completely) please read
the "What's going on in SVN post" from me.

-- 
Thanks,
Thomas


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to