Delphi 是否可以为导入的 OLE/COM 类型库自动生成事件支持代码?
我正在尝试为 Outlook 2003、2007 和 2010(以及其他 OLE 服务器)生成类似于与 Delphi for Outlook 2000 和 2002 捆绑的导入单元。但是,我无法获得类型库导入程序还生成用于从捆绑单元中找到的 OLE 服务器捕获事件的代码。 “生成组件包装器”选项仅为可直接实例化的服务器创建包装器,而不为仅通过其他对象(如 TInspector
、TExplorer
等)的方法返回的对象创建包装器我
当然可以自己创建事件处理代码,但这将是非常乏味的工作。
有谁知道是否可以调整 Delphi 2010 (tlibimp.exe
) 中包含的导入程序来生成该代码?我真的很怀疑 Borland 是否手动创建了现有的 Outlook2000.pas
和 OutlookXP.pas
单元……
是否还有其他工具可以做到这一点?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好问题!我从来没有注意到那些组件没有被创建(我只使用Word_TLB)。使用 tlibimp 玩了一下后,我发现您需要
-Yc+
标志。可能所有忽略标志都是默认打开的。注意:这是在 Delphi 7 上使用 tlibimp.exe 版本 7.0.4.453
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