Trying to use COM... "Type mismatch" error

Mark Hammond mhammond at skippinet.com.au
Thu May 8 22:53:37 EDT 2003


Simon Withers wrote:

> OK, I used Makepy on a third party .dll file, TGLLib.dll which is used
> from VB to create/add to localized string files, for use in a game
> (Bridge Commander, if anyone cares..)
> 
> Now, I come to import TGLLib, and it turns out that things haven't
> quite worked right, if the VB Code is anything to go by.  The
> CoClasses don't have access to the functions that they need from the
> DispatchBaseClasses, and when I tinker around a little to let them get
> access, it returns

You should just be able to run makepy, then use win32com.client.Dispatch 
as normal.  Evertthing should "just work" (but unfortunately doesn't for 
some).

> com_error: (-2147352567, 'Exception occurred.', (0, 'TGLLib', 'Type
> mismatch', None, 1000013, -2146828275)

This means that TGLLib itself threw an exception.  This often means that 
you passed an incorrect type.

Can you post the complete interactive session, and the traceback.  Also 
please include a "print repr(ob)" in the output, where "ob" is the COM 
object you are trying to call.

Mark.





More information about the Python-list mailing list