Windows 7、IE8:创建 CAxWindow 已完成,但出现“拒绝访问”错误

发布于 2024-10-01 00:36:27 字数 546 浏览 2 评论 0原文

我有 Windows 7、Internet Explorer 8、Visual Studio 2008。 我需要创建 Active X 窗口来显示其他站点的页面。我尝试在 IE 处于保护模式时创建 CAxWindow 窗口。如果当前站点不受信任,它将返回访问被拒绝错误 (5)。

新窗口的类定义为:

class CNewWnd: public CWindowImpl<CNewWnd, CAxWindow, CWinTraits<WS_CHILD | WS_BORDER, WS_EX_TOOLWINDOW>>

创建新窗口实现为:

hWndContainer = Create(hParent, r);

其中hParent是浏览器的HWND。结果 hWndContainer = NULL 且 GetLastError() 返回 5。MSDN

的文章“理解并在保护模式下工作 Internet Explorer”仅描述了如何使用系统注册表、文件和进程 - 没有任何有关窗口创建的内容。

I have Windows 7, and Internet Explorer 8, Visual Studio 2008.
I need to create Active X window which will show page from other site. I try to create CAxWindow window while IE in Protected Mode. It returns Access Denied error (5) if current site isn't trusted.

Class of new window defined as:

class CNewWnd: public CWindowImpl<CNewWnd, CAxWindow, CWinTraits<WS_CHILD | WS_BORDER, WS_EX_TOOLWINDOW>>

Create new window implemented as:

hWndContainer = Create(hParent, r);

where hParent is HWND of browser. As result hWndContainer = NULL and GetLastError() returns 5.

MSDN's article "Understanding and Working in Protected Mode Internet Explorer" describes only working with System Registry, Files and Processes - none of word about windows creating.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文