FAQ
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

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

Now, I'm just a poor confused newbie at COM, so I have no idea what I
might be doing wrong, or whether it's just not a .dll that I can use
properly, or what.

If anyone has any helpful suggestions, I'd love to hear them!

Simon Withers

Search Discussions

  • Mark Hammond at May 9, 2003 at 2:53 am

    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.
  • Simon Withers at May 9, 2003 at 9:58 am
    Mark Hammond <mhammond at skippinet.com.au> wrote in message news:<RKEua.6539$_o4.90224 at news-server.bigpond.net.au>...
    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.
    Hi Mark,
    Here's the interactive session...
    from win32com.client import Dispatch
    myTGL = Dispatch("TGLLib.TGLFile")
    print repr(myTGL)
    <win32com.gen_py.22E8D31A-01EE-4EB1-9AED-07264C052957x0x25x0._TGLFile>
    myTGL.Filename="D:\myTGL.tgl"
    myTGL.Load()
    print repr(myTGL.Strings)
    <win32com.gen_py.22E8D31A-01EE-4EB1-9AED-07264C052957x0x25x0._TGLStrings>
    myTGL.Strings.Lookup()
    (None, u'')
    myTGL.Strings.Add(Name=u'Name', Data=u'This is my data',
    Media=u'media.wav')
    Traceback (most recent call last):
    File "<interactive input>", line 1, in ?
    File "D:\Python22\Lib\site-packages\win32com\gen_py\22E8D31A-01EE-4EB1-9AED-07264C052957x0x25x0.py",
    line 65, in Add
    return self._ApplyTypes_(0x60030003, 1, (9, 0), ((16392, 3),
    (16392, 3), (16392, 3), (16396, 19)), 'Add',
    '{248731B8-8D33-4B18-9219-240086A375F6}',Name, Data, Media, Key)
    File "D:\Python22\Lib\site-packages\win32com\client\__init__.py",
    line 341, in _ApplyTypes_
    return self._get_good_object_(apply(self._oleobj_.InvokeTypes,
    (dispid, 0, wFlags, retType ,argTypes ) + args), user, resultCLSID)
    com_error: (-2147352567, 'Exception occurred.', (0, 'TGLLib', 'Type
    mismatch', None, 1000013, -2146828275), None)
    >>>

    Hope it sheds some light on things...

    Simon

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMay 8, '03 at 5:00p
activeMay 9, '03 at 9:58a
posts3
users2
websitepython.org

2 users in discussion

Simon Withers: 2 posts Mark Hammond: 1 post

People

Translate

site design / logo © 2021 Grokbase