[转]COM,ATL,WTL,OLE,STL,MFC

COM ATL WTL学习资料 学习com时,免不了提到ATL,学习WTL,也免不了会看到ATL、COM。 现在把这些资料打个包,以供学习,此包包括: COM技术内幕 COM原理与应用 Essntial COM 《com原理与应用》源代码 ATL开发指南 Inside ATL WTL Developer's Guide 深入剖析WTL 立即下载

This part referenced from Microsoft 

What is COM?

Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. COM objects can be created with a variety of programming languages. Object-oriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects. The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX? Controls.


Microsoft provides COM interfaces for many Windows application programming interfaces such as Direct Show, Media Foundation, Packaging API, Windows Animation Manager, Windows Portable Devices, and Microsoft Active Directory (AD).


COM is used in applications such as the Microsoft Office Family of products. For example COMOLEtechnology allows Word documents to dynamically link to data in Excel spreadsheets and COM Automation allows users to build scripts in their applications to perform repetitive tasks or control one application from another.

What is COM+?
COM+ is the name of the COM-based services and technologies first released in Windows 2000. COM+ brought together the technology of COM components and the application host of Microsoft Transaction Server (MTS). COM+ automatically handles programming tasks such as resource pooling, disconnected applications, event publication and subscription and distributed transactions.
I want to build a COM or COM+ application. How do I get started?
The best resource for COM developers is the Microsoft Developer Network (MSDN). The MSDN Library contains information for developers on the Microsoft platform including a programming guide for COM development and the COM API programming reference. The Windows API is documented in Win32 and COM Development. You will also find information on COM+.
Using COM from .NET and .NET from COM
The .NET Framework provides bi-directional interoperability with COM, which enables COM-based applications to use .NET components and .NET applications to use COM components. For information on how to access .NET components from COM see http://msdn.microsoft.com/library/ms973802.aspx. To learn how to use COM components from .NET see http://msdn.microsoft.com/library/ms973800.aspx.

下面模型参考自:《COM应用程序框架》

                                                   

                                                                                                             使用MFC+ATL组合图: 

                                                 

                                                                                                       使用WTL+ATL组合图

从上面两附图中很容易看出,使用MFC+ATL组合开发COM应用程序框架,MFC存在一层函数调用,代码执行速度会慢一些。小程序可能看不出来,大程序也就明显了。   如果使用WTL+ATL组合开发COM应用程序框架,就不会多一层调用,代码执行速度非常快,就像是用Win32 SDK编写代码一样没有什么区别,因为WTL是模板代码,在编译后不会存在一层函数调用。所以《COM应用程序框架》将采用WTL+ATL组合进行设计,这可能是最佳方案。

Below part referenced from wikipedia

What is the OLE?

Object Linking and Embedding (OLE) is a technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control eXtension (OCX), a way to develop and use custom user interface elements. On a technical level, an OLE object is any object that implements the IOleObject interface, possibly along with a wide range of other interfaces, depending on the object's needs.

Overview:

OLE allows an editing application to export part of a document to another editing application and then import it with additional content. For example, a desktop publishing system might send some text to a word processor or a picture to a bitmap editor using OLE. The main benefit of OLE is to add different kinds of data to a document from different applications, like a text editor and an image editor. This creates a compound document and a master file to which the document references. Changes to data in the master file immediately affects the document that references it. This is called "linking" (instead of "embedding").
Its primary use is for managing compound documents, but it is also used for transferring data between different applications using drag and drop and clipboard operations. The concept of "embedding" is central to the inclusion of multimedia in Web pages, such as video, animation (including Flash animations), and audio files within the hypertext markup language (such as HTML or XHTML) or other structural markup language used (such as XML or SGML). Modern browsers may use different embedding mechanisms than OLE.

---------------------------------

PS: 下面部分引用自百度百科:

Object Linking and Embedding,对象连接与嵌入,简称OLE技术。OLE 不仅是桌面应用程序集成,而且还定义和实现了一种允许应用程序作为软件“对象”(数据集合和操作数据的函数)彼此进行“连接”的机制,这种连接机制和协议称为组件对象模型(COM)。

OLE 是在客户应用程序间传输和共享信息的一组综合标准。允许创建带有指向应用程序的链接的混合文档以使用户修改时不必在应用程序间切换的协议。OLE基于组件对象模型(COM) 并允许开发可在多个应用程序间互操作的可重用即插即用对象。该协议已广泛用于商业上,在商业中电子表格、字处理程序、财务软件包和其他应用程序可以通过客户/服务器体系共享和链接单独的信息。
  OLE 是一种面向对象的技术,利用这种技术可开发可重复使用的软件组件(COM)。
  关于 OLE ,业界早就在抱怨它的缓慢和庞大,对市场敏感的 Microsoft 需要对那些 API 函数提出一种新的术语以适应未来的操作系统和 Internet 技术。有趣的是 Microsoft 已经宣布 OLE 不再代表对象链接与嵌入,而只是一个过去的名词而已。


This part referenced from wikipedia

What is ATL?

The Active Template Library (ATL) is a set of template-based C++ classes developed by Microsoft, intended to simplify the programming of Component Object Model (COM) objects. The COM support in Microsoft Visual C++ allows developers to create a variety of COM objects, OLE Automation servers, and ActiveX controls.[1][2] ATL includes an object wizard that sets up primary structure of the objects very quickly with a minimum of hand coding. On the COM client side ATL provides smart pointers that deal with COM reference counting.

Controls for the Internet market could have been made with the Microsoft Foundation Classes (MFC), but the market requires controls to be small and compact for downloading over the network from Web servers. MFC applications tend to be large and require support DLLs.[3] ATL allows creating smaller controls without support DLLs, so ATL is in a sense a lightweight alternative to MFC for the COM control environment.
A common use of ATL in Active Server Pages (ASP) is to construct objects that can be called from a script. While limited in certain respects, VBScript is able to call C++ Windows code contained in a COM object. In ATL version 7 (Visual Studio 2003), which directly succeeded version 3 (Visual Studio 6.0), a number of MFC classes like CString have been made available in ATL, or more precisely have been moved to an ATLMFC common layer which is shared by both libraries. ATL version 7 also introduced attributes in C++ using numerous behind the scene tricks (macros, even registry entries) in an attempt to provide something similar toCLIattributes, however these have not been particularly successful, and have been deemphasized in ATL version 8 (Visual Studio 2005); the various wizards no longer generate them by default. Version 7 also introduced new string conversion classes, which unlike their entirely-macro-based predecessors balance safety and performance: the stack allocation for the converted string is now limited to a size specified at compile-time (via a template parameter) and above that watermark heap allocation is performed.
On July 28, 2009, Microsoft released a patch to ATL to fix a bug that could allow ActiveX controls created using ATL to be vulnerable to a remote code execution security flaw.[4]

---------------------------------

其设计旨在让人们用C++方便灵活地开发COM对象。ATL本身相当小巧灵活,这是它最大的优点。用它可以创建轻量级的,自包含的,可复用的二进制代码,不用任何附加的运行时DLLs支持.


Below part referenced from wikipedia

What is the WTL?

The Windows Template Library (WTL) is a free software, object-oriented C++ template library for Win32 development. WTL was created by Microsoft employee Nenad Stefanovic for internal use and later released as an unsupported add-on to Visual Studio and the Win32 Framework SDK. It was developed primarily as a light-weight alternative to the Microsoft Foundation Classes and builds upon Microsoft's ATL, another lightweight API widely used to create COM and ActiveX libraries.

WTL provides support for implementing various user interface elements, from frame and popup windows, to MDI, standard and common controls, common dialogs, property sheets and pages, GDI objects, and other common UI elements, such as scrollable windows, splitter windows, toolbars and command bars. WTL's main objective is to deliver small and efficient code, close in size and speed to "straight" SDK programs while providing a higher-level and more flexible object model to developers. Other classes such as a string wrapper that is syntax-compatible with MFC's CString and some templated collections are also included.
Most of the WTL API is a mirror of the standard Win32 calls, so the interface tends to be familiar to most Windows programmers. Although no official documentation from Microsoft exists, the WTL Documentation Project is attempting to create a comprehensive reference for the library.[1] The WTL is not supported by Microsoft Product Support Services.

----------------------------------

WTL 架构在ATL上,对Windows 用户界面UI方面的API进行了封装,使得Windows 应用的UI开发变得十分简单、方便。
ATL 中原本就包括了一套面向Windows编程的类和类模板,其初衷是用来支持ATL 中Com 控件和OLE 属性页开发的,这也成了WTL的窗口编程的基础。 ATL 提供了基本的窗口编程功能,包括Window/Dialog 创建和管理,以及完整的消息机制。

Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.


Below part referenced from wikipedia

What is the STL?[标准模版库]

The Standard Template Library (STL) is a C++ software library which heavily influenced many parts of the C++ Standard Library. It provides four components called algorithms, containers, functional, and iterators.[1]
The STL provides a ready-made set of common classes for C++, such as containers and associative arrays, that can be used with any built-in type and with any user-defined type that supports some elementary operations (such as copying and assignment). STL algorithms are independent of containers, which significantly reduces the complexity of the library.
The STL achieves its results through the use of templates. This approach provides compile-time polymorphism that is often more efficient than traditional run-time polymorphism. Modern C++ compilers are tuned to minimize any abstraction penalty arising from heavy use of the STL.
The STL was created as the first library of generic algorithms and data structures for C++, with four ideas in mind: generic programming, abstractness without loss of efficiency, the Von Neumann computation model,[2] and value semantics.

-----------------------------------

从根本上说,STL是一些“容器”的集合,这些“容器”有list,vector,set,map等,STL也是算法和其他一些组件的集合。


Below part referenced from wikipedia

What is the MFC?

The Microsoft Foundation Class Library (also Microsoft Foundation Classes or MFC) is a library that wraps portions of the Windows API in C++ classes, including functionality that enables them to use a default application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls.

Features:
At the time of its introduction, MFC provided C++ macros for Windows message-handling (via Message Maps), exceptions, run-time type identification (RTTI), serialization and dynamic class instantiation.
The macros for message-handling aimed to reduce memory consumption by avoiding gratuitous virtual table use and also to provide a more concrete structure for various Visual C++-supplied tools to edit and manipulate code without parsing the full language. The message-handling macros replaced the virtual function mechanism provided by C++.
The macros for serialization, exceptions, and RTTI predated availability of these features in Microsoft C++ by a number of years. 32-bit versions of MFC, for Windows NT 3.1 and later Windows operating systems, used compilers that implemented the language features and updated the macros to simply wrap the language features instead of providing customized implementations, realizing upward compatibility.

----------------------------------

MFC六大关键技术:

1.MFC程序的初始化部分;

   MFC有固定的类结构,根据C++的继承、多态特性把Win32对应的各部分放入MFC的封装模块中;

2.RTTI(Runtime Type Information)运行时类型识别;

   通过链表实现,每个类型都保存在一个结构中[对性名称,基类、派生类],通过这些信息,保证了RTTI的实现;

3.Dynamic Creation动态创建;

4.Persistence永久保存;

5.Message Mapping消息映射;

6.Message Routing消息传递;

港口集装箱码头运营FlexSim仿真 列队4中的集装箱会根据不同类型的集装箱会放置在不同的堆场,因此根据前面对集装箱设置的标签Type的数值不同,设置不同的发送端口。集装箱到达列队3后,会有70%的集装箱到达堆场,30%的集装箱运出港口,因此在Queue列队3的Flow界面设置按照百分比发送端口,其中70%发送到端口1,即发送到列队4等待进入堆场,30%发送到端口2,即发送至出闸口。通过上述对比表格可以看出,当集卡数量在10的时候,岸桥和场桥的设备利用率达到了最高,当集卡数量为12的时候场桥1和场桥3的利用率有所下降,因此综合考虑。 阅读详情

相关推荐

用树莓派搭建全功能NAS服务器(01):树莓派基础操作&OMV搭建

写在前面 对于文件互传来说,局域网和云盘的操作总是独立的,而且很难将两者的优势合为一体。如果想要集多种优势为一体,那么NAS应该就是较为完美的解决方案了。 在这个系列中我们尽量跳过一些枯燥的理论知识,专注于说明两件事:   1.NAS是什么&能做什么 2.搭建思路&怎么做   这中间也会涉及到一些方案的选择,同类方案我也会列出来和大家分享我已知的优缺点,有兴趣可以多种尝试。(侧重于软件) 虽然是用树莓派搭建的,但是对于debian linux系统下的NAS搭建有着很好的参

斯塔克家的真维斯的工作间 2万+

COM, ATL, WTL, STL, OLE, MFC

This part referenced from Microsoft What is COM? Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. ...

huobengluantiao8 193

Python xlwings报错解决:从‘NoneType‘到完美运行WPS表格的完整指南

本文深入解析了使用Python xlwings库自动化WPS表格时遇到的经典'NoneType'报错(AttributeError: 'NoneType' object has no attribute 'apps')的根源与解决方案。核心在于pywin32版本与WPS的兼容性问题,文章提供了从版本降级、依赖管理到构建健壮自动化环境的完整实战指南,帮助开发者彻底解决兼容性难题,实现稳定运行。

n4o5p6q7r的博客 303

COM,ATL,WTL,OLE,STL,MFC

This part referenced from MicrosoftWhat is COM?Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is...

u010018619的博客 497

基于Zynq的便携式γ能谱仪设计与实现

数字多道分析器(DMCA)是核辐射能谱测量的核心设备,其本质是将探测器输出的模拟脉冲按幅度数字化分道,构建能量-计数分布曲线,从而支撑放射性核素识别与定量分析。其技术原理依赖高速采样、数字滤波成形、基线恢复与峰值提取等关键信号处理环节,具备高分辨率、优线性度与强抗干扰能力。在环境监测、核安全巡检与野外地质勘探等场景中,对低功耗、小型化、实时性提出严苛要求。本方案采用Xilinx Zynq-7020异构SoC架构,融合FPGA实时数字信号处理与ARM嵌入式控制,实现软硬协同优化,兼顾算法精度与工程落地性,为国

weixin_33173126的博客 190

硬件工程师八大细分岗位详解:从芯片到整机的技术分工与职业选择

硬件工程作为电子系统设计的核心领域,涉及从芯片级到整机级的完整技术链条。其基本原理是通过电路设计、信号处理和功率管理等技术,将电子元件集成为功能完备的硬件系统。随着产品复杂度提升,硬件工程师岗位出现高度专业化分工,这种细分不仅提升了技术深度,更优化了团队协作效率。在工程实践中,信号完整性和电源完整性成为高速数字设计的两个关键技术挑战,直接影响系统稳定性。本文基于行业热词"硬件工程师"和"信号完整性",深入解析八大细分岗位的技术差异,帮助从业者明确职业发展方向,构建系统化的硬件设计思维。

weixin_33811539的博客 451

com,atl,wtl之间的联系

COM是一种二进制轻量级组件模型,有关它的理论和书籍文章太多了,但是要说清楚至少需要一大本书。windows操作系统中以及微软的所有其他主打产品(如office)全部离不开COM架构。最简单地说,COM是一种软件开发规范,按照标准的IDL描述语言对外公开接口及其方法,符合这种规范开发的组件能有效地实现二进制级别的互通。客户端对服务器组件的接口调用是完全透明的,两者可以在同一个进程中、不同进程间甚至

xxhhjjww的专栏 515

从零玩转Vitis裸机开发:手把手教你创建、移植与实战优化

✅ Vitis裸机开发全流程✅ 中断系统配置技巧✅ 跨平台移植方法论✅ 性能优化实战经验研究FreeRTOS移植探索AMP(非对称多处理)架构学习使用Vitis Analyzer进行性能分析技术雷达:关注Xilinx最新推出的Vitis Unified IDE,其集成了更强大的调试和分析工具。立即动手实践吧!

QQ_778132974的博客 584

STL,ATL,WTL之间的联系和区别

一、STL即 Standard Template Library (标准模板库)       STL是惠普实验室开发的一系列软件的统称。它是由Alexander Stepanov、Meng Lee和David R Musser在惠普实验室工作时所开发出来的。现在虽说它主要出现在C++中,但在被引入C++之前,该技术就已经存在了很长的一段时间。STL的代码从广义上讲分为三类:algorithm

wangwenjing90的专栏 7421

GStreamer —— 2.1、Windows搭建GStreamer环境,Qt加载GStreamer库后运行 - “教程1:Hello world!“(附:完整源码)

GStreamer —— 2、Windows搭建GStreamer环境,Qt加载GStreamer库后运行"教程1:Hello world!"

797

AI原生SaaS应用的自动化运维体系构建

随着ChatGPT掀起的AI原生应用浪潮,越来越多SaaS(软件即服务)产品开始以"AI优先"的方式设计——从用户交互到核心功能,都深度依赖机器学习模型(如推荐算法、智能客服)、实时数据流(如用户行为分析)和弹性算力(如大模型推理)。这类应用的运维需求与传统SaaS完全不同:传统运维像"修水管",哪里漏了补哪里;AI原生运维则像"照顾会成长的宠物",需要实时感知模型状态、数据变化和流量波动,主动调整资源。

AI天才研究院 1080

STL ATL WTL MFC, COM OLE ActiveX区别与联系

MFC、WTL 、ATL、STL联系与区别 这个要先从C++和VC++说起! c++是一门语言,它与平台无关。只要能提供c++编译器(或者交叉编译器)的平台,就能用c++编程。基本上常见的操作系统都有C++编译器或交叉编译器,所以你可以认为几乎所有的平台都可以使用C++编程。 首先要明确,严格来说VC++不是语言,而是一个工具软件。他甚至不是编译器,而是一个开发环境(VC++的编译器实际上只

碎虚空 1406

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

C++ STL,ATL,WTL之间的联系和区别

C++ STL,ATL,WTL之间的联系和区别 2013年12月05日 16:09:55LoveApp_Han阅读数 15283 STL即 Standard Template Library (标准模板库) STL是惠普实验室开发的一系列软件的统称。它是由Alexander Stepanov、Meng Lee和David R Musser在惠普实验室工作时所开发出来的。现在虽说它主要出现...

cxu123321的博客 965

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

《转》STL ATL WTL COM

STL即 Standard Template Library (标准模板库) STL是惠普实验室开发的一系列软件的统称。它是由Alexander Stepanov、Meng Lee和David R Musser在惠普实验室工作时所开发出来的。现在虽说它主要出现在C++中,但在被引入C++之前该技术就已经存在了很长的一段时间。 STL的代码从广义上讲分为三类:algorithm(算法)、contai

louiswang2009的专栏 678

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

MFC、WTL 、ATL、STL联系与区别

MFC、WTL 、ATL、STL联系与区别    这个要先从C++和VC++说起!    c++是一门语言,它与平台无关。只要能提供c++编译器(或者交叉编译器)的平台,就能用c++编程。基本上常见的操作系统都有C++编译器或交叉编译器,所以你可以认为几乎所有的平台都可以使用C++编程。   首先要明确,严格来说VC++不是语言,而是一个工具软件。他甚至不是编译器,而是一个开发环境(

学海无涯 2542

转载:atl组件和控件编程 wtl,atl

正在处理您的请求... <!-- function getObject(objectId) { if(document.getElementById) { return document.getElementById(objectId) } else if(document.all&&document.all(objectId))

prophet08的专栏 1294

WTL,ATL与MFC之比较

http://blog.youkuaiyun.com/jack_incredible/article/details/7962488 MFC,ATL,WTL的历史沿袭 需求推动了技术的发展,从MFC到ATL,从ATL再到WTL的发展历程我想就是一个最好的见证。 MFC是Win API与C++的结合. 早期的VC++开发者们发现了MFC(Microsoft Foundation Classes)

在线笔记 1965

开始学习WTL——(1)关于STL/ATL/WTL之间的区别

在这之前我一直在使用MFC框架,现在要学习WTL似乎有些牵强...... 俗话说得好:“工欲善其事,必先利其器”,还是先将基本术语搞清楚吧! 1、STL 即 Standard Template Library     STL(标准模板库)是惠普实验室开发的一系列软件的统称。它是由Alexander Stepanov、 Meng Lee和David R Musser在惠普实验室工作时

Koma的主页 2065
上一篇: 我的简历应该是这样子的
下一篇: WTL\MFC\ATL CSTRING的前世今生
月球人
博客等级 码龄15年 6粉丝 40原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值