Activex控件奇怪问题
1.本人做了一个MDI的activex控件,在IE和窗体应用程序中可以正常使用
2.现在由于需要将该控件集成到WPF中,创建的是WPF application时也可以正常使用,
3.但创建的是WPF Browser application程序时,出错.
调用如下:
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
AxzebdemrLib.Axzebdemr ax = new AxzebdemrLib.Axzebdemr();//此处为activex控件
host.Child = ax;
抛出System.Reflection.TargetInvocationException异常.
Additional information: Unable to get the window handle for the 'Axzebdemr' control. Windowless ActiveX controls are not supported
4.但如果引用到的是activex的debug版本,可以正常运行
5.查看了debug和release的,设置不同的地方就是release,增加了代码优化和运行时链接库的方式不一致.
有尝试去掉release的代码优化,依然报错.
请各位大侠帮忙!谢谢!