Is it possible to have Delphi auto-generate event-support code for an imported OLE/COM type library?

StackOverflow https://stackoverflow.com/questions/3600576

Question

I'm trying to generate _TLB import units for Outlook 2003, 2007 and 2010 (and also other OLE servers) analogous to the ones bundled with Delphi for Outlook 2000 and 2002. However, I couldn't get the type library importer to also generate the code for capturing events from the OLE servers that is found in the bundled units. The option to "Generate component wrappers" only creates wrappers for servers that are directly instantiatable but not for objects that are only returned via methods of other objects like TInspector, TExplorer, etc.

I could of course create the event handling code myself but that would be really tedious work.

Does anyone know if the importer contained with Delphi 2010 (tlibimp.exe) can be tweaked to generate that code? I really doubt that back in the day Borland created the existing Outlook2000.pas and OutlookXP.pas units manually...

Are there maybe any other tools around that can do this?

Was it helpful?

Solution

Good question! I never noticed that those components were not created (I only use Word_TLB). After playing a bit with tlibimp I found out that you need the -Yc+ flag. Probably all ignore flags are default on.

NB: this is on Delphi 7 with tlibimp.exe version 7.0.4.453

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top