ATL中添加网页窗口
来源:互联网 发布:真实世界数据 编辑:程序博客网 时间:2024/05/24 06:49
This article was previously published under Q192560
SUMMARY
This article explains how to add Active Template Library (ATL) generic control containment capability to any window, so that the window can host ActiveX controls. The control containment support conforms to the OCX 96 specification and supports windowless activation and flicker-free drawing.
MORE INFORMATION
To add control containment, follow these steps:
- Add the following header files and pragma directives to your code. If you want to link to the containment code in Atl.dll, add the following code:Atl.dll must be shipped when you use ATL containment code, regardless of whether you Min Size build or Min Dependency build. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
// AtlAxWinInit is implemented in Atl.dll #pragma comment(lib, "atl.lib") #include <atldef.h> #define _ATL_DLL_IMPL #include <atliface.h>
244955 ATL projects built for MinDependency need Atl.dll if the projects use ATL control containment code in Visual C++ 6.0 - Add the following code to the application initialization code, for example in the beginning of WinMain():
//Initialize ATL control containment code. AtlAxWinInit();
- Create the ActiveX controls: use the WIN32 CreateWindow() function, specify "AtlAxWin" as the class name, and then specify either a GUID, a ProgID, or an URL as the title. For example:
// Create the Calendar control specifying the ProgID. // Make sure that the module handle you pass to CreateWindow is the // same module handle where AtlAxWinInit() was called from. HWND hWnd = ::CreateWindow("AtlAxWin", "MSCAL.Calendar", WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL, ::GetModuleHandle(NULL), NULL); // Same as above, except CLSID is specified instead of ProgID. // Corresponds to ProgID "MSCAL.Calendar.7" HWND hWnd = ::CreateWindow("AtlAxWin", "{8E27C92B-1264-101C-8A2F-040224009C02}", WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL, ::GetModuleHandle(NULL), NULL); // Creates the Web Browser control and navigates to the // specified web page. HWND hWnd = ::CreateWindow("AtlAxWin", "http://www.microsoft.com", WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL, ::GetModuleHandle(NULL), NULL); // Creates an instance of an dynamic HTML document. HWND hWnd = ::CreateWindow("AtlAxWin", "mshtml:<H1>Hello World</H1>", WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL, ::GetModuleHandle(NULL), NULL);
- If you added _Module.Init(), add the following code in application termination code (for example, in WinMain(), after the message loop):
_Module.Term()
Properties
Article ID: 192560 - Last Review: September 2, 2005 - Revision: 3.0
APPLIES TO
- Microsoft ActiveX Template Library 3.0, when used with:
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords:
kbhowto kbcontainer kbatlwc kbctrl kbfaq KB192560Back to the top | Give Feedback
0 0
- ATL中添加网页窗口
- ATL中显示窗口
- 在ATL中实现窗口
- 在ATL中实现窗口
- 在ATL中实现窗口
- 在mfc对话框中添加一个显示网页的窗口
- 在ATL中实现窗口(精)
- ATL窗口
- ATL窗口
- 添加网页加载进度窗口
- 在ATL接口中添加自定义函数
- 在MFC工程中添加ATL
- 在ATL项目中添加WTL界面
- VS2013编写嵌入网页的ATL控件2-给ATL控件添加鼠标响应
- 在ATL DLL中实现在窗口中使用CDockablePane
- 网页中添加音频视频
- 网页中添加音频视频
- 在ATL无窗口ACTIVEX控件中响应timer消息
- struts后台校验
- 编程学习文档 参考资料和文档
- php学习高级-提高PHP编程效率的几点建议
- uva 10010 Where's Waldorf?
- Libgdx中Hiero的下载、运行、生成、使用
- ATL中添加网页窗口
- android_移植memtester
- python Image模块安装
- 交通灯管理系统视频
- Paxos 算法
- SSH+Racle整合问题之3 问题真是一个接一个从来不松懈阿
- 博士科研论坛和一些学者研究
- nyoj 139 我排第几个--康拓展开
- 访问 IIS 元数据库失败