problems with python: pywintypes.com_error

Mark Hammond mhammond at skippinet.com.au
Fri Aug 8 22:08:44 EDT 2003


Matt Smith wrote:

> I am calling a program called v2wreg (its a program for interfacing 
> with the registers/parallel port, used, unfortunatly i think 
> exclusivly, by the company I work for), I can load the program fine, 
> but when I come to use any of its advanced featurs i.e. 
> SetDeviceAddress or ReadRegister I get the same type of error message.
> 
> i.e.  
> File "<COMObject v2wreg.Application>", line 2, in MakeConnection
> pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1)

These generally mean you are passing the incorrect param types to the 
object.  It is the object complaining, not Python.

Some things look a little suspect - eg:

serialBusToolv2wReg.SetDeviceAddress = self.deviceAddress

It is likely this should be written as:

serialBusToolv2wReg.DeviceAddress = self.deviceAddress

or

serialBusToolv2wReg.SetDeviceAddress(self.deviceAddress)

If you still have trouble, you should try reducing it down to no more 
than 5 lines of Python that demonstrates the problem, and the equivilent 
VB/Anything code that works.

Mark.





More information about the Python-list mailing list