Windowless ActiveX controls are not supported wind

2019-08-21 15:03发布

问题:

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:

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

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

This did not help.

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();

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.

回答1:

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

I found my problem. Using procmon.

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.