[python-win32] COM and Makepy when DLL and TLB are separated

Mark Hammond mhammond at skippinet.com.au
Thu Dec 4 18:04:48 EST 2003


tlb and the dlls should be able to work when they are discrete, and does for
most other objects.  Even when they are in the same file, it is quite common
that the typelib is just a "blob" in the file anyway.

makepy just uses LoadRegTypeLib in most cases, but depending on the params
you pass, may open using the .tlb name directly.

I'm not completely clear on your environment though.  It sounds like your
DLL *also* has a typelib - if you try and run makepy over a DLL without a
typelib it will fail.  If your DLL attempting to extend interfaces in the
.tlb?  If not, why is there type info available in both the .tlb and the
.dll?

Mark.

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Chris Brandson
> Sent: Thursday, 4 December 2003 5:50 AM
> To: python-win32 at python.org
> Subject: [python-win32] COM and Makepy when DLL and TLB are separated
>
>
> I need to access an InProc COM interface which was originally
> designed for
> VB and has a separate type library (".tlb" file) and DLL. An
> additional
> problem is that some of the arguments are ByRef and are
> modified during
> invocation. Makepy can generate source files for both the DLL
> and typelib.
> The typelib has interfaces defined but CLSIDToClassMap is
> empty. The DLL has
> a  CLSIDToClassMap for the classes but no interfaces defined
> (they are in
> the tlb). I had hoped that win32com.client would combine TLB
> and DLL and
> allow access, but when I create the top level object from the
> ProgID with
> Dispatch, none of the properties or methods seen to be found e.g.
> "AttributeError: '<win32com.gen_py.<DLL COM entry>.<interface
> name>' object
> has no attribute 'Initialize'. Is there documentation
> somewhere on what
> makepy is actually doing. There is some info in "Python Programming on
> Win32", but I haven't been able to map what is there to my
> case with a DLL
> and TLB.
>
> Is there something I need to do to link the DLL and TLB or is
> the issue
> related to the fact that just about every method needs
> arguments passed by
> reference?
>
> Any assistance would be greatly appreciated.
>
> Thanks,
>
> - Chris
>
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32




More information about the Python-win32 mailing list