它是如何正确地实现IDTExtensibility2接口的Office COM加载项? [英] How it is correctly to implement IDTExtensibility2 interface for Office COM Add-In?

查看:1562
本文介绍了它是如何正确地实现IDTExtensibility2接口的Office COM加载项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在执行COM加载项用于Outlook。我用IDTExtensibility2的。我不知道这是否是做COM加载项的最佳方式,但我不能改变的。

I am implementing COM Add-In for Outlook. I use IDTExtensibility2. I am not sure whether this is the best way of doing COM Add-Ins but I cannot change that.

该接口定义了五种方法:的OnConnection,OnStartupComplete,OnAddInsUpdate,OnBeginShutdown,OnDisconnection

This interface defines five methods: OnConnection, OnStartupComplete, OnAddInsUpdate, OnBeginShutdown, OnDisconnection.

我需要执行以下操作:

  1. 从文件加载配置数据
  2. 加载注册表数据
  3. 在开始新的会话
  4. 创建* .pst文件
  5. 订阅浏览器事件
  6. 连接到Internet服务器,以获取一些数据
  7. 创建在主菜单中的菜单项
  8. 创建一个工具栏
  9. 添加/删除几件事情Outllok(上* .pst文件级)

请指教,我所应该做的是什么时候?

Please advise, what I am supposed to do when?

  • 在我需要的OnConnection方法来执行呢?
  • 在只允许什么时候OnStartupComplete调用?
  • 在什么样的资源,我需要释放过程中处置OnBeginShutdown / OnDisconnection?

推荐答案

需要注意的是1,2和6是不是Outlook,插件特定的任务。

Note that 1,2 and 6 are not Outlook-addin-specific tasks.

3是没有必要:作为一个插件,你没有创建一个会话 - 你得到连接现有的(通过实施的OnConnection 法)

3 is not needed: As an addin you don't create a session - you get connected with an existing one (by implementing the OnConnection method).

有关4和9,我建议使用RDO: http://dimastr.com/redemption/ (也可用于3,如果你真的需要另一个会话)

For 4 and 9 I recommend using RDO: http://dimastr.com/redemption/ (can also be used for 3 if you really need another session)

有关5,7和8,我建议使用ADX: HTTP://www.add-in-ex$p$pss.com/add-in-net/
(你不会真正担心 IDTExtensibility2的的,如果你做的这一切了)

For 5,7 and 8 I recommend using ADX: http://www.add-in-express.com/add-in-net/
(you won't actually have to worry about IDTExtensibility2 at all anymore if you do this)

的OnConnection 是你抓你参考应用程序的界面,你可以得到一切。

OnConnection is where you grab your reference to the Application interface from which you can derive everything else.

OnStartupComplete 在这里,你可以把你所有的初始化code。

OnStartupComplete is where you can put all your initialization code.

OnDisconnection 是应该释放所有剩余的OOM引用您可以在会话过程中累积的,即从最初的应用衍生的一切如果您通过接收到的参考的OnConnection

OnDisconnection is where you should release all remaining OOM references you may have accumulated during the session, i.e everything that was derived from the initial Application reference that you received via OnConnection.

这篇关于它是如何正确地实现IDTExtensibility2接口的Office COM加载项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆