[python-win32] Re: More COM Problems

Roger Upole rwupole at msn.com
Wed Sep 7 14:58:06 CEST 2005


If you know where the application's typelib (*.tlb) is, you can run makepy
manually against it.  You can also run makepy on an exe, dll, or ocx
if it contains type information. Alternately, you might be able to register
the typelib using pythoncom.RegisterTypeLib if the application
doesn't do so itself.

      hth
        Roger


pylist at gnulinux.net wrote:
>
>
>
> I still can't seem to get this to work correctly. Here is the code I am 
> testing with:
>
> ---
> import win32com.client
> from win32com.client import gencache, Dispatch
> import os, sys
> from win32com.shell import shell
> import win32com.client.dynamic
>
> print "Creating late-bound Optix object"
> xl = win32com.client.dynamic.Dispatch("Optix.Application")
> print "The Optix object is", `xl`
>
> gencache.EnsureModule('{4BD66BC4-4AA0-11CF-A13A-00A024140CAD}', 0, 1, 2)
> optix = Dispatch("Optix.Application")
> print optix
> sys.exit(0)
> ---
>
> The output is:
> Creating late-bound Optix object
> The Optix object is
>
>
>
> The actual above gencache statement was not copied from the makepy utility 
> as it
> could not find Optix.Application (or the classid) so I just ran it on 
> another
> object and replaced it's classid with Optix's classid.
>
> I have noticed that Optix.Application is not in the TypeLib list inside of 
> makepy
> utility though it does show up under all onjects in MS's OLE Browser.
>
> Another odd thing is that I can use Optix.Application in python (to some 
> degree)
> but can't use it for what I need sense makepy/gencache doesn't seem to 
> make anything.
>
> Please Help! :-)
> Steve Milner 



More information about the Python-win32 mailing list