如果C ++ COM-AddIn侦听Excel :: IWorkbookEvents,Excel 2010在保存工作簿时崩溃。 [英] Excel 2010 crashes when saving Workbook if C++ COM-AddIn listens to Excel::IWorkbookEvents.

查看:71
本文介绍了如果C ++ COM-AddIn侦听Excel :: IWorkbookEvents,Excel 2010在保存工作簿时崩溃。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

详细信息:

>使用VS 2010.

>它只发生在Release构建中,Debug构建工作正常。

> AddIn通过AtlAdvise连接到工作簿。

>如果在领先的BeforeSave(..)事件中调用AtlUnadvise,则不会发生崩溃。

>引用计数是一个潜在的问题,但是,它似乎工作正常,否则为Application,Workbook和Worksheet对象创建和删除代理对象。为什么保存工作簿影响引用计数?

解决方案


嗨sborum,



 



感谢您的帖子。



< p style ="margin:0in 0in 0pt"> 你想发布你的代码,以便我们可以尝试repro你的问题在我们这边,因为我们无法检测到发布的位置e没有足够的细节。



 





Details:
> Using VS 2010.
> It only happens in Release build, Debug build works fine.
> The AddIn connects to the Workbook through AtlAdvise.
> The crash doesn't happen if AtlUnadvise is called on the leading BeforeSave(..) event.
> Reference count is a potential issue, however, it seems to work fine otherwise creating and deleting proxy objects for Application, Workbook and Worksheet objects. And why should saving a Workbook influence reference count?

解决方案

Hi sborum,

 

Thanks for your post.

Would you like to post your code so that we can try to repro your issue on our side as we are unable to detect where the issue occurs without enough details.

 

Have a nice day,


这篇关于如果C ++ COM-AddIn侦听Excel :: IWorkbookEvents,Excel 2010在保存工作簿时崩溃。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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