[python-win32] Problems using makepy

Mark English Mark.English at liffe.com
Thu Sep 2 12:33:28 CEST 2004


Hi,
I'm trying to automate Visual Studio 7.1 with Python, but can't generate
one of the type library wrappers with make_py.
Running make_py like this:
python "c:\Program
Files\Python23\Lib\site-packages\win32com\client\makepy.py" "Visual
Studio 7.1 Deployment Projects Type library"

And getting results like this:
Generating to C:\Program
Files\Python23\Lib\site-packages\win32com\gen_py\32453F51-EFD3-4D13-8A74
-AB598B93FA57x0x1x0.py
Traceback (most recent call last):
  File "c:\Program
Files\Python23\Lib\site-packages\win32com\client\makepy.py", line 369,
in ?
    rc = main()
  File "c:\Program
Files\Python23\Lib\site-packages\win32com\client\makepy.py", line 362,
in main
    GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel,
bForDemand = bForDemand, bBuildHidden = hiddenSpec)
  File "c:\Program
Files\Python23\Lib\site-packages\win32com\client\makepy.py", line 266,
in GenerateFromTypeLibSpec
    gen.generate(fileUse, bForDemand)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\genpy.py", line 746, in
generate
    self.do_generate()
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\genpy.py", line 806, in
do_generate
    oleItems, enumItems, recordItems, vtableItems =
self.BuildOleItemsFromType()
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\genpy.py", line 718, in
BuildOleItemsFromType
    oleItem, vtableItem = self._Build_Interface(type_info_tuple)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\genpy.py", line 698, in
_Build_Interface
    vtableItem = VTableItem(info, attr, doc)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 112, in
__init__
    self.Build(typeinfo, attr, bForUser)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 393, in
Build
    DispatchItem.Build(self, typeinfo, attr, bForUser)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 260, in
Build
    self._AddFunc_(typeinfo,fdesc,bForUser)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 181, in
_AddFunc_
    arg_type, arg_clsid, arg_doc = _ResolveType(typerepr, typeinfo)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 437, in
_ResolveType
    subrepr, sub_clsid, sub_doc = _ResolveType(subrepr, itypeinfo)
  File "C:\Program
Files\Python23\Lib\site-packages\win32com\client\build.py", line 452, in
_ResolveType
    resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr)
pywintypes.com_error: (-2147312566, 'Error loading type library/DLL.',
None, None)

I've tried debugging it but get lost as to what property/method is being
built. Any ideas how to identify/solve the problem ? Would throwing the
error away be acceptable ?

This hasn't particularly hampered things yet since the script I'm
cobbling together works fine even if the following call fails:
gencache.EnsureModule('{32453F51-EFD3-4D13-8A74-AB598B93FA57}', 0, 1, 0)

I haven't checked the details but I presume it's doing some late-binding
instead (or perhaps I'm just not using any objects from that type
library...). Overall the VS7.1 automation model seems a bit buggy so I
wouldn't be too surprised if the type library is pushing the boundaries
somewhat. I believe it lives here:
c:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\Deployment\Vspkgs\dpprj.dll

I've messed around with win32com\gen_py deleting the relevant generated
file, so if there's any other cached info lying around somewhere I
should have cleared up please let me know. I didn't see anything in the
documentation (yet).

Cheers for any assistance,
mE


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies.
-----------------------------------------------------------------------



More information about the Python-win32 mailing list