Win:Get Class-ID for DLL and OCX

Mark Hammond MHammond at skippinet.com.au
Thu May 20 05:48:02 EDT 1999


Norbert.Klamann at pobox.com wrote in message <7i05l7$8u1$1 at nnrp1.deja.com>...
>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

I suggest your requirements are pretty specific, so instead of using the
makepy function you should be looking at the implementation of that
function, and using the raw pythoncom calls.

for example, you will probably find all you need is:

tlb = pythoncom.LoadTypeLib(path_to_dll)
c = tlb.GetLibAttr()

If these functions fail for your OCX, then hopefully the COM error will give
you the details of exactly why.

Hope this helps...

Mark.







More information about the Python-list mailing list