Win:Get Class-ID for DLL and OCX

Norbert.Klamann at pobox.com Norbert.Klamann at pobox.com
Thu May 20 01:13:11 EDT 1999


Hello all,
I want to get the Class-ID for a given DLL-Name and use at the moment
code like the following (extracted and cleaned up, hope it works
still...):
---
from win32com.client import makepy

  s = makepy.GetTypeLibsForSpec(PathToDLL)
  a = s[0]
  if len(s) > 1 :
    print '  Mehrere Class-IDs vorhanden !!! Ünberprüfen!'
  c = a[1] # c ist selecttlb.TybelibSpec
---
then c contains the members  clsid ,major,minor, dll

It is a rather crude hack I think, because I use makepy and ignore
the backgrounds of COM-processing.
It works for System-DLLs, self-written DLLS, System OCXs
but _Not_ for self-written OCXes.


Does anybody know why ? Or can anybody suggest a better way to do this ?

Background:
For a customer I have to deal with a great VB-Project.
For our builds we have to recompile a dozen or so DLLs, OCXs and EXEs
in the right order with this or that compatibility-level.
If one changes the compatibility-level of a 'lower' DLL the refernces
in the dependent projects break (sometimes silently) and have to be
restored.

The whole process is extremely tedious and error-prone when done
manually.

So I wrote a python-script which works on a list of VB-project-files.
Each VB-project-file is read, the references are updated with the hack
above ( and some additional black magic ),
the file is written back again, the VB-Compiler gets started
and it runs as fast as a VB-Compiler can run.

But we have OCXes too and there I get the problem above.
For reasons which I can only guess are OCX-references described in
the VBP-Files in another format than the DLLs. So the File-Name
doesn't contain a path.

If youl would like to see the script, feel free to mail me, but it
is not ready yet.

Many thanks for Your time


Norbert
--
Norbert Klamann
Klamann Software & Beratung GmbH i.Gr
Erftstadt Germany
Klamann.Software at pobox.com


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---




More information about the Python-list mailing list