Windows 2008R2不支持无窗口ActiveX控件-在Windows 7中有效 [英] Windowless ActiveX controls are not supported windows 2008R2 - Works in Windows 7

查看:330
本文介绍了Windows 2008R2不支持无窗口ActiveX控件-在Windows 7中有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用旧式供应商com对象的Windows窗体应用程序。我已经注册了ocx。 VS2010项目成功引用了axFOO dll。该代码可在Windows 7上运行的Visual Studio中工作。安装项目将正确安装,并且如果安装在我的本地PC(win7)上,它将正常工作。当我尝试在Windows 2008 VM上安装时,安装成功,当执行使用该对象的应用程序部分时,它失败并显示以下错误:

I have a windows forms application that uses legacy vendor com objects. I've registered the ocx. The VS2010 project succeeds in referencing the axFOO dll. The code works in Visual studio running on Windows 7. The setup project installs correctly and if installed on my local PC (win7) it works. When I attempt to install on a windows 2008 VM, installation is successful, when the portion of the application that uses the object is executed it fails with this error:


无法获取 xx控件的窗口句柄。不支持无窗口ActiveX控件。

Unable to get the window handle for the 'xx' control. Windowless ActiveX controls are not supported.

我已经注册了ocx文件。我找到了几篇有关Vista和DEP的文章。没什么关于Win7和Win2008的区别。我现在使用命令关闭了DEP

I have the ocx file registered. I found several articles about Vista and DEP. Nothing regarding the difference in Win7 and win2008. I have DEP turned off right now using the command

bcdedit.exe /set {current} nx AlwaysOff

这没有帮助。

应用程序用C#编写。
有什么建议吗?我更习惯于ASP.net。 COM对我来说是新的。谢谢。

Application is written in C#. Any suggestions? I'm more accustomed to ASP.net. COM is new to me. Thanks.

此外,我已经确定在初始化方法期间触发了异常:

Also, I've identified the exception is triggered here during Initialize method:

 ((System.ComponentModel.ISupportInitialize)(this.myCtrl)).EndInit();

更多详细信息:
我已经在Win2008计算机上安装了VS 2010,以尝试使两者更相似,没有运气。在VS2010调试模式下运行时,会出现相同的问题。 -遇到异常时不在VS中停止。

More details: I've installed VS 2010 on the Win2008 machine to try and make the two more similar with no luck. Same problem occurs running in VS2010 debug mode. -not stopping in VS when exception hits. Although I didn't expect it to.

推荐答案

将其放在此处以防其他人使用。

Putting this here in case it helps someone else. not exactly an answer..

我发现了我的问题。使用procmon。

I found my problem. Using procmon.

因此,与所声明的错误无关。执行com对象的用户对我不知道需要使用的文件夹没有IO权限。

So it was nothing to do with the stated error. The user executing the com object didn't have IO permissions to a folder I didn't know it needed to use.

这篇关于Windows 2008R2不支持无窗口ActiveX控件-在Windows 7中有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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