ActiveX 控件在发布模式下崩溃,但在调试模式下不崩溃

发布于 2024-11-05 12:29:20 字数 634 浏览 3 评论 0原文

我继承了用 c++/c 编写的 activeX 控件的维护,该控件在发布模式下崩溃,但在调试模式下不会崩溃。

当嵌入到网页中时,此 AX 控件会在发布模式下触发访问冲突,但不会在调试模式下触发访问冲突

以下是 IE 8 的详细信息

Description:  
  Stopped working  

Problem signature:  
  Problem Event Name:   APPCRASH  
  Application Name: iexplore.exe  
  Application Version:  8.0.7601.17514  
  Application Timestamp:    4ce79912  
  Fault Module Name:    mymodule.OCX  
  Fault Module Version: 13.0.0.771  
  Fault Module Timestamp:   4dc325f9  
  Exception Code:   c0000005  
  Exception Offset: 003ebc80  
  OS Version:   6.1.7601.2.1.0.256.1  
  Locale ID:    1033  

有人对如何解决此问题有建议吗?

I have inherited the maintainance of an activeX control written in c++/c that crashes in release mode but not in debug mode.

When embedded in a web page, this AX control triggers an access violation in release mode but not in debug mode

Here are the details from IE 8

Description:  
  Stopped working  

Problem signature:  
  Problem Event Name:   APPCRASH  
  Application Name: iexplore.exe  
  Application Version:  8.0.7601.17514  
  Application Timestamp:    4ce79912  
  Fault Module Name:    mymodule.OCX  
  Fault Module Version: 13.0.0.771  
  Fault Module Timestamp:   4dc325f9  
  Exception Code:   c0000005  
  Exception Offset: 003ebc80  
  OS Version:   6.1.7601.2.1.0.256.1  
  Locale ID:    1033  

Do anyone have recommendations on how to go about addressing this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无人问我粥可暖 2024-11-12 12:29:20

在您的发布版本中生成调试符号。然后就可以调试崩溃了。

或者,不要等待崩溃发生,而是在执行导致崩溃发生的步骤之前附加到进程。在 VS 异常对话框中,当引发访问冲突时让 VS 立即停止(调试 | 异常 | Win32 异常 | c0000005)。然后重现;此时,当 AV 发生时,VS 应该显示一个消息框。

如果崩溃每次都在同一个地方重现,应该很容易诊断。

Generate debug symbols in your release build. Then you can debug the crash.

Alternatively, instead of waiting for the crash to happen, attach to the process before following the steps that cause the crash to occur. In the VS exceptions dialog, have VS stop immediately when an access violation is thrown (Debug | Exceptions | Win32 Exceptions | c0000005). Then repro; at that point, VS should display a message box when the AV happens.

If the crash repros at the same place everytime, should be easy to diagnose.

浮华 2024-11-12 12:29:20

因为我花了很多时间来找到正确的解决方案,所以我在这里分享:

传递给 CreateControl 的许可证字符串必须已使用 SysAllocString 或您的许可 ActiveX 控件进行分配可能会崩溃。在我的项目中,这仅在发布模式下...不知道为什么它在调试模式下工作。

此处间接找到了解决方案。

Because I have lost lots of time to find the right solution, I share it here:

The license string passed to CreateControl must have been allocated using SysAllocString, or your licensed ActiveX control may crash. On my project, this was only in Release mode... Don't know why it works in Debug mode.

Found the solution indirectly here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文