我有一个PowerPoint的COM加载项,其中包含两个TaskPanes。在PowerPoint 2016 64位以外的所有版本中,我们都没有发现问题,但是在该版本中,PowerPoint在启动时(在我们的计算机和客户端计算机上)挂起。
我用两个TaskPanes编写了一个小型的虚无测试加载项,这些加载项表现出相同的行为,即在PowerPoint 2010、2013(所有版本)和PowerPoint 2016(32位)上都可以,但是在PowerPoint 2016中挂起。在各个任务窗格事件中放入一些诊断OutputDebugString,并在DebugView日志中查看以下内容...
PowerPoint 2013 and 2016(32)
============================
00000002 4.34796715 [3864] TaskPaneBeforeCreate
00000003 4.46064138 [3864] Initialise TaskPane1
00000004 4.50027180 [3864] TaskPaneAfterCreate: TL="TaskPane1"
00000005 4.50116539 [3864] TaskPaneBeforeShow: TL="TaskPane1"
00000006 4.52554655 [3864] TaskPaneAfterShow: TL="TaskPane1"
00000007 4.52557039 [3864] TaskPaneBeforeCreate
00000008 4.53154325 [3864] Initialise TaskPane2
00000009 4.53265429 [3864] TaskPaneAfterCreate: TL="TaskPane2"
00000010 4.53280926 [3864] TaskPaneBeforeShow: TL="TaskPane2"
00000011 4.53707695 [3864] TaskPaneAfterShow: TL="TaskPane2"
PowerPoint 2016(64)
============================
00000002 4:42:28.674 PM [9932] TaskPaneBeforeCreate
00000003 4:42:28.719 PM [9932] Initialise TaskPane1
00000004 4:42:28.729 PM [9932] ActivateEvent TaskPane1
00000005 4:42:28.729 PM [9932] TaskPaneAfterCreate: TL="TaskPane1"
00000006 4:42:28.730 PM [9932] TaskPaneBeforeShow: TL="TaskPane1"
00000007 4:42:28.753 PM [9932] TaskPaneAfterShow: TL="TaskPane1"
00000008 4:42:28.763 PM [9932] TaskPaneBeforeCreate
00000009 4:42:28.765 PM [9932] Initialise TaskPane2
00000010 4:42:28.765 PM [9932] DeactivateEvent TaskPane1
00000011 4:42:28.791 PM [9932] ActivateEvent TaskPane2
00000012 4:42:28.791 PM [9932] TaskPaneAfterCreate: TL="TaskPane2"
00000013 4:42:28.797 PM [9932] TaskPaneBeforeShow: TL="TaskPane2"
00000014 4:42:28.813 PM [9932] TaskPaneAfterShow: TL="TaskPane2"
00000015 4:42:28.942 PM [9932] DeactivateEvent TaskPane2
00000016 4:42:28.944 PM [9932] ActivateEvent TaskPane1
00000017 4:42:28.951 PM [9932] DeactivateEvent TaskPane1
00000018 4:42:28.957 PM [9932] ActivateEvent TaskPane2
00000019 4:42:28.957 PM [9932] DeactivateEvent TaskPane2
00000020 4:42:28.961 PM [9932] ActivateEvent TaskPane1
00000021 4:42:28.961 PM [9932] DeactivateEvent TaskPane1
00000022 4:42:28.973 PM [9932] ActivateEvent TaskPane2
00000023 4:42:28.973 PM [9932] DeactivateEvent TaskPane2
... and this then goes on forever hanging the machine!!
如您所见,问题似乎是由于激活事件(可能需要事先停用当前活动的窗格)而导致表单启动逻辑发生了变化,并且陷入了无限循环。
有人知道我如何解决此问题吗?
非常感谢
理查德·泰勒