COM :: VARIANT -eek

Matt Smith s0199583 at sms.ed.ac.uk
Thu Aug 14 04:47:31 EDT 2003


Mark Hammond <mhammond at skippinet.com.au> wrote in message news:<bhefuk$2gvi$1 at arachne.labyrinth.net.au>...
> Matt Smith wrote:
> > Mark Hammond <mhammond at skippinet.com.au> wrote in message news:<bha8cu$2q3l$1 at arachne.labyrinth.net.au>...
>  
> > My problem is now this, when i go to makepy tool in pythonwin, it does
> > not see/recognise the type library file I want it to convert. Is there
> > anyway to add the file to the list of .tlb files it does does?
> 
> These type libraries are in the registry.  You may be able to pass the 
> filename on the commandline to makepy.
> 
> > p.s. How do I include the generated makepy file into my code ?
> 
> In generaly, you just need to generate the file and do nothing else.  At 
> runtime, Python will see these generated files and automatically use them.
> 
> I don't know how that will go with your type library though.
> 
> Mark

Hi again, 

I had to register the .tlb file (as it didnt do it automatically at
installation [don't know why]) using a vb .tlb registration script,
which worked fine and now I have a lovily makepy.py generated file for
my .tlb file.

My problem is now this, When I try to run the file (in pythonwins
interactive window) using the code:

  from win32com.client include gencache
  gencache.EnsureModule('{AF684923-D245-11D3-8DE8-00A024ACAB85x0x1x0}',
0, 1, 0)

pythonwin returns the error:

ImportError: No module named
gen_py.AF684923-D245-11D3-8DE8-00A024ACAB85x0x1x0

I have tested it with other makepy.py generated files and they all
return the same error. Do I need to tell python where to find these
makepy files? or is there some other reason as to why it does not want
to use ANY makepy.py files

thanks for all the help,
matt.




More information about the Python-list mailing list