> I am interested in helping with the auto creation of the typelib file.
Excellent! Sadly, google can't seem to find my earlier posts on this topic. Many years ago I posted sample code that could create a typelib from pure-python. > > On 7/25/07, Rasjid Wilcox <[EMAIL PROTECTED]> wrote: > > As for helping with the auto-create idea, what kind of experience is > > needed, and do we have any idea of how much work is involved? > > Based on my reading so far, it seems that what is required is the > auto-generation of the appropriate IDL file, which can then be > compiled into a TLB file using the standard Microsoft MIDL compiler. > It would appear to me that the creation of the IDL file could be done > entirely in Python, without a deep knowledge of C being required. > Have I missed something? Is it more complex than this? There should be no need to create an IDL file - enough interfaces are exposed so that we can create the typelib directly. The problem I see is how to infer the intent of the Python programmer, who probably does *not* want to author the interfaces externally. In other words, the typelib should be able to be created only from information inside the .py file. class MyCOMObject: ... def Foo(self, bar): return "foo" Somehow we need to allow this to be annotated so that the programmer can say "bar must be a string, and the result must be a string". Last I thought about this, Python 'decorators' were just a gleam in someone's eye, so they may offer a solution. Ideally, we would look at tools like pyrex which may already have grown ways to annotate types of things it deals with. Another (easier) issue is to decide on the semantics for creation of the typelib - eg, do we force the programmer to nominate the typelib GUID, and any version annotations necessary? How hard do we try to stop them shooting themselves in the foot by, for example, changing method signatures without chaning the version or GUID? etc. > My employer would be interested in getting this working as long as the > amount of work involved is measured in weeks and not months, as would > provide a clean way to migrate vb6 apps to Python in an incremental > manner. That sounds great! As implied above, I don't think the major problems will be related to the actual creation of the typelib, but instead in determining what to populate it with. If the "obviously correct" answer was apparent today (along with code that could extract this info), I'd expect it could be done in a matter of days. Cheers, Mark _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32