[python-win32] Problems with automation in newer versions of win32all

greg Landrum greglandrum at mindspring.com
Fri May 28 17:49:11 EDT 2004

Upon upgrading to Python 2.3 and installing the most recent version of win32all (build 163), some frequently used COM client code ceased to function.

The exception I'm seeing is:
  File "chemdraw.py", line 89, in CDXConvert
  File "c:\Python23\Lib\site-packages\win32com\gen_py\5F646AAB-3B56-48D2-904C-A68D7989C251x0x7x0.py", line 416, in SetData
    return self._oleobj_.InvokeTypes(21, LCID, 4, (24, 0), ((12, 17), (12, 17),(12, 17), (12, 17), (12, 1)),dataType, resolution, Width, Height, arg4)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147352571), 5)

The definition of SetData() (from the auto-generated file) looks like this:
	# The method SetData is actually a property, but must be used as a method to correctly pass the arguments
	def SetData(self, dataType=defaultNamedNotOptArg, resolution=defaultNamedNotOptArg, Width=defaultNamedNotOptArg, Height=defaultNamedNotOptArg, arg4=defaultUnnamedArg):
		"""Returns the data of the objects."""
		return self._oleobj_.InvokeTypes(21, LCID, 4, (24, 0), ((12, 17), (12, 17), (12, 17), (12, 17), (12, 1)),dataType, resolution, Width, Height, arg4)

SetData() is being called with proper arguments (2 strings)

I first encountered this problem about  a year ago using Python 2.2 and discovered that it started at build 150 of win32all (my earlier message about this same problem can be found at URL: http://aspn.activestate.com/ASPN/Mail/Message/Python-win32/1686417 ).  My "solution" then was to just stick with using build 148.  Unfortunately, now that I've switched to Python 2.3, this is no longer an option.

This is a serious problem for us, I would be very grateful for any solutions or work-arounds.


More information about the Python-win32 mailing list