描述:
vc创建新工程里的ATL和ActiveX到底各在什么情况下使用?
ATL COM 和 MFC ActiveX Control 的区别是什么,可否请哪位大虾指点一下?谢谢
比如做出来的控件是在web上用的,主要想知道什么时候该创建ATL,什么时候创建ActiveX?
解决方案1:
<atl开发指南>据说也不错
解决方案2: atl可以做进程内服务(比如dll)和进程间服务(比如系统服务)供你的应用程序调用,比如你可以把数据库的访问作出atl com组件,你的应用程序只需要调用它提供的接口函数就可以获取数据等.
只做过atl,没做过MFC ActiveX Control ,只能谈点atl了,抱歉
要用到MFC的话 用 MFC ActiveX Control
ActiveX 也是一种COM
只是调调API函数就用ATL
activex是一个规范,而mfc和atl只是两个工具而已,所以没有什么哪个做出来能用在哪,而另一个工具做出来的就不行
解决方案5: activex控件一般都是ui控件,就是有界面的,比如按钮,对话框等等, acitivex控件也是com组件的一种
mfc activex control顾名思义它是使用mfc开发的,
atl com组件是使用atl库,做出的com组件比较小巧
INFO: Difference Between OLE Controls and ActiveX Controls
SUMMARY
The specification for ActiveX controls has been relaxed to give developers the ability to create smaller, faster controls that are more suitable for the Internet. In the new object linking and embedding (OLE) control specification, we make use of component categories, which relax previous rules that identify interfaces as being mandatory and allow greater flexibility to efficiently target certain areas of functionality without having to provide superfluous support to qualify as a control. The OLE control specification also adds some new features such as windowless objects, URL monikers, asynchronous monikers, progressive downloading, and OLE Hyperlinks. Perhaps most importantly, you can mark controls as safe for data download and safe for scripting.
Keep in mind that an ActiveX control is just another term for an "OLE Object" or "Component Object Model (COM) Object." A "COM Object" must support the IUnknown interface. In addition, all ActiveX controls must be self-registering; as a result, an in-process control must implement and export DllRegisterServer and DllUnregisterServer. With NT 4.0 built-in marshaling support for the connection point interfaces, a control can now be a local server. This means that the control creates and registers its class factory objects with the system when it is first run. Because IUnknown does not allow you to do much, you want to implement at least one additional interface. However, these minimal requirements allow controls to be as lightweight as possible.
Mike McKeown addresses this very confusing issue of OLE controls versus ActiveX controls in the October 1996 issue of the MIND (Microsoft Internet Developer) magazine.
For more information on enabling controls for the Internet, as well as which interfaces and functions an ActiveX control supports, see the "ActiveX Controls" section of the ActiveX SDK online documentation.
MORE INFORMATION
1. Q. What is the difference between an OLE control and an ActiveX control?
A. No difference. "ActiveX control" renames and restructures the OLE controls technology. For marketing reasons, the term OLE has come full circle and once again refers to the OLE technologies that apply to object linking and embedding only. The term "OLE control" has been replaced with the "ActiveX control" to distance the name from the older Object Linking and Embedding technology with which controls have very little in common. No one should use the term "OLE control" anymore.
2. Q. Is an OCX an "ActiveX control"?
A. No, an OCX is a file that can hold one or more ActiveX controls. These files do not need to have the .ocx extension (some are .dll files) and thus should not be referred to as "OCXs". This also links them to a file extension which is what our document-centric paradigm is trying to eliminate.
3. Q. Are out-of-the-box OLE controls (such as the one that shipped with Visual Basic 4.0) also ActiveX controls?
A. Yes, all controls that we formerly called "OLE controls" are ActiveX controls. This excludes VBXs and Windows Custom Controls because they were never OLE-based to start with.
4. Q. How about MFC controls? Are they also ActiveX controls?
A. Yes, all MFC controls are ActiveX controls. An old Visual C++ 4.0 control is an ActiveX control, as is one that is created with Visual Basic 4.0. View the term "ActiveX control" as a renaming and restructuring, an evolution of the OLE control technology.
A control can be built to work efficiently on the Internet, to be hosted in desktop container applications,&n