Using a type library with win32com

Jan Persson jpersson1 at yahoo.com
Wed May 21 10:19:09 EDT 2003


Hi,

I have not seen a good answer to this in the previous (old) postings,
so here we go again.

I would like to create a COM-server in Python (with an ordinary
IDispatch interface) together with a type library (tlb file), so that
environments which relies on type library information can be able to
instantiate my class.

>From the previous postings I have learnt to do the following:

1. Create the Python class that implements my automation-server.
2. Create an IDL-file and compiled it with midl.exe.
3. Take the resulting tlb-file and register it with REGTLIB.EXE
4. Register the Python class with
win32com.server.register.UseCommandLine().

But this does not seem to work.

Is this the correct way to do it or is win32com able to generate
typelib information on it's own?

Does anyone have a working example on how to accomplish this?

Kind regards
    //Jan Persson




More information about the Python-list mailing list