ThisAddIn_ShutDown不执行 [英] ThisAddIn_ShutDown doesn't execute

查看:891
本文介绍了ThisAddIn_ShutDown不执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的附加在Outlook中,我有以下行。

 私人无效ThisAddIn_Startup(对象发件人,系统。 EventArgs五)
{
MessageBox.Show(Hazaa!);
}

私人无效ThisAddIn_Shutdown(对象发件人,发送System.EventArgs)
{
MessageBox.Show(Shazoo ......);
}



在Outlook迎接我一个爽Hazaa!在它开始,它拒绝走Sahzoo ...在我当我',关闭它。这两种方法都注册使用默认设置,自动生成的代码以同样的方式,所以我不怀疑任何错误出现。我能想到的另一个解释是,当应用程序已经离开了GUI关停过程被执行,shazooing是隐藏的。



会这样呢?如果没有,我怎样才能使Outlook shazoo我吗? ?如果是这样,我怎么能直观地通知用户这样一个shazoo的



编辑:



显然,因为O10,关机不再被调用,所以下面的自动生成的代码的确实错的(或至少不完美)。 @ Christian.K礼貌。

 #地区VSTO生成的代码
私人无效InternalStartup()
{
this.Startup + =新System.EventHandler(ThisAddIn_Startup);
this.Shutdown + =新System.EventHandler(ThisAddIn_Shutdown);
}
#endregion


解决方案

您是否使用展望2010年




在Outlook 2010年开始,Outlook中,默认情况下,没有信号加载项
,它正在关闭。具体来说,Outlook将不再要求快速关机期间,
OnBeginShutdown和IDTExtensibility2的
接口OnDisconnection方法。同样,一个Outlook插件以书面
与Microsoft Visual Studio Tools for Office中不再调用当Outlook关闭
ThisAddin_Shutdown方法。



In my add-in for Outlook, I have the following lines.

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
  MessageBox.Show("Hazaa!");            
}

private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
  MessageBox.Show("Shazoo...");
}

While Outlook greets me with a cool "Hazaa!" upon its start, it refuses to go "Sahzoo..." on me when I', closing it. Both methods are registered in the same way using the default, auto-generated code, so I don't suspect any errors there. The other explanation I can think of is that the shutting down process is executed when the application already has left the GUI and the shazooing is hidden.

Is it so? If not, how can I make Outlook shazoo me? If so, how can I notify a user visually of such a shazoo?

EDIT:

Apparently, since O10, the shut down is no longer to be called, so the auto-generated code below is indeed wrong (or at least not perfect). Courtesy of @Christian.K.

#region VSTO generated code
private void InternalStartup()
{
  this.Startup += new System.EventHandler(ThisAddIn_Startup);
  this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion

解决方案

Are you using Outlook 2010?

Starting in Outlook 2010, Outlook, by default, does not signal add-ins that it is shutting down. Specifically, Outlook no longer calls the OnBeginShutdown and OnDisconnection methods of the IDTExtensibility2 interface during fast shutdown. Similarly, an Outlook add-in written with Microsoft Visual Studio Tools for Office no longer calls the ThisAddin_Shutdown method when Outlook is shutting down.

这篇关于ThisAddIn_ShutDown不执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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