COM :: VARIANT -eek

Matt Smith s0199583 at sms.ed.ac.uk
Thu Aug 14 05:11:23 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.
> 

okay update on present situation ran (in pythonwin interactive
window):

>>> import win32com.client
>>> from win32com.client import gencache
>>> from win32com.client import pythoncom
>>> gencache.EnsureModule('{AF684923-D245-11D3-8DE8-00A024ACAB85}', 0,
1, 0)
<module 'win32com.gen_py.AF684923-D245-11D3-8DE8-00A024ACAB85x0x1x0'
from 'win32com\gen_py\AF684923-D245-11D3-8DE8-00A024ACAB85x0x1x0.py'
>>> v = win32com.client.Dispatch("v2wreg.Application")
>>> print v
<COMObject v2wreg.Application>

as you can see the module is now being found but when I go to use
dispatch it does not use the module as it was intructed to ?

cheers,
matt.




More information about the Python-list mailing list