简体   繁体   English

ActiveX OCX在发布模式下可以注册,但在调试模式下不能注册

[英]ActiveX OCX can register when built in release mode but not in debug mode

I'm running into an irritating problem. 我遇到了一个令人烦恼的问题。 Using Visual Studio 2008 on a Windows 7 SP1 64-bit OS, I rebuilt an ActiveX control that has been working for years at a customer site. 我在Windows 7 SP1 64位操作系统上使用Visual Studio 2008,重建了一个ActiveX控件,该控件已经在客户站点上使用了多年。 It was built in Release mode. 它是在发布模式下构建的。 But when I tested the control, it crashed. 但是当我测试控件时,它崩溃了。 I tried to build it in Debug mode, but it could not be registered. 我试图在“调试”模式下构建它,但无法注册。 The error message is: 错误消息是:

"The module ... may not be comnpatible with the version of Windows that you're running. Check if the module is conpatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe." “该模块...可能与您正在运行的Windows版本不兼容。请检查该模块是否与regsvr32.exe的x86(32位)或x64(64位)版本兼容。”

I tried registering it with both 64-bit and 32-bit versions of regsvr32, and got the same error with both of them. 我尝试使用64位和32位版本的regsvr32进行注册,但两者均出现相同的错误。

I'd really like to be able to use the debugger with this control. 我真的很希望能够将调试器与此控件一起使用。 If I can't, I'll have to just throw message boxes into my control until I can identify the spot where it's crashing. 如果不能这样做,则只需要在控件中放入消息框,直到可以确定崩溃的位置。

Use Dependency Walker to Profile registering your OCX and see what it complains about. 使用Dependency Walker剖析注册OCX并查看其抱怨的地方。 When registering any version of your OCX, appropriate versions of your dependencies must be available to your OCX. 注册任何版本的OCX时,您的OCX必须可用适当版本的依赖项。 To Profile open the correct bitness regsvr32.exe into Dependency Walker, select Profile and enter the name of your OCX in the Program Arguments field. 要进行Profile,请在Dependency Walker中打开正确的regsvr32.exe,选择Profile,然后在Program Arguments字段中输入OCX的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM