Win32All InvokeTypes exception after upgrade

Mark Hammond mhammond at skippinet.com.au
Thu Jul 31 19:08:25 EDT 2003


At the top of the makepy generated files, there are a couple of 
"default" values.  These were recently changed from 'pythoncom.Missing' 
to 'pythoncom.Empty'.  This change was made so "named parameters" would 
work in most objects.

The problem is that the semantics for COM defaults are not well defined 
- different objects use different techniques.

I guess you have 2 choices:
* Explicitly pass 'pythoncom.Missing' in these params.
* Copy your makepy generated file to a local file, rename it, change the 
defaults, and import this module for your project.

Or I guess the third option is to help me look into making this work for 
everyone.  Unfortunately, this is the first problem report I have had, 
but there have beenp lenty of success reports that the new strategy 
works better.

Mark

barry g wrote:

> When trying to upgrade my Win32All package from build 148, that came
> in the ActiveState install, to any of v150 thru v156 I start receiving
> an exception.  It apparently is related to the "output arguments" in
> the ActiveX control's methods.  If I leave the output parameters off I
> get the message at the bottom.  If I fill the arguments the function
> performs happily.
> 
> Am I missing some step or setting that makes the output parameters
> optional again?  I could change all my code to supply dummy values,
> but we have a large enough number of COM controls and function calls
> that I'd prefer to maintain the old calling style if possible.
> 
> obj.DeviceToLatLon(x,y,10,10) #works in either 148 or 156 
> (35.453, -75.2214) 
> 
> obj.DeviceToLatLon(x,y) #used to return a tuple - now generates
> exception
> Traceback (most recent call last):
>   File "ChartNotebook.py", line 978, in OnMouseMove
>     lat, lon = obj.DeviceToLatLon(x, y)
>   File "C:\Python22\lib\site-packages\win32com\gen_py\8754AEB3-1466-11D4-A779-0050DA6B8675x0x1x2.py",
> line 62, in DeviceToLatLon
>     return self._oleobj_.InvokeTypes(37, LCID, 1, (24, 0), ((3, 0),
> (3, 0), (16389, 0), (16389, 0)),x, y, lat, lon)
> com_error: (-2147352571, 'Type mismatch.', None, 3)
> 
> 
> Thanks,
> Barry





More information about the Python-list mailing list