没有合适的资源?快使用搜索试试~ 我知道了~
首页Microsoft Component Object Model (aka COM) Specification
资源详情
资源推荐
The Component Object Model Specification
Version 0.9
October 24, 1995
This document contains the specification to the Component Object Model (COM), an architecture and
supporting infrastructure for building, using, and evolving component software in a robust manner. This
specification contains the standard APIs supported by the COM Library, the standard suites of interfaces
supported or used by software written in a COM environment, along with the network protocols used by
COM in support of distributed computing. This specification is still in draft form, and thus subject to
change.
Note: This document is an early release of the final specification. It is
meant to specify and accompany software that is still in development.
Some of the information in this documentation may be inaccurate or
may not be an accurate representation of the functionality of the final
specification or software. Microsoft assumes no responsibility for any
damages that might occur either directly or indirectly from these
inaccuracies. Microsoft may have trademarks, copyrights, patents or
pending patent applications, or other intellectual property rights
covering subject matter in this document. The furnishing of this
document does not give you a license to these trademarks, copyrights,
patents, or other intellectual property rights.
Copyright
ٛ
1992-95 Microsoft Corporation. All Rights Reserved
The Component Object Model Specification The Component Object Model
Copyright
ٛ
1992-95 Microsoft Corporation Page: ii DRAFT: October 24, 1995
All Rights Reserved
The Component Object Model Specification
Draft Version 0.9, October 24, 1995
Microsoft Corporation and Digital Equipment Corporation
Copyright
ٛ
1992-95 Microsoft Corporation.
Microsoft does not make any representation or warranty regarding the Specification or any product or item
developed based on the Specification. Microsoft disclaims all express and implied warranties, including
but not limited to the implied warranties of merchantability, fitness for a particular purpose and freedom
from infringement. Without limiting the generality of the foregoing, Microsoft does not make any war-
ranty of any kind that any item developed based on the Specification, or any portion of it, will not infringe
any copyright, patent, trade secret or other intellectual property right of any person or entity in any country.
It is your responsibility to seek licenses for such intellectual property rights where appropriate. Microsoft
shall not be liable for any damages arising out of or in connection with the use of the Specification, includ-
ing liability for lost profit, business interruption, or any other damages whatsoever. Some states do not
allow the exclusion or limitation of liability for consequential or incidental damages; the above limitation
may not apply to you.
The Component Object Model The Component Object Model Specification
Table of Contents
How to Read This Document 5
Part I: Component Object Model Introduction 7
1. Introduction 9
1.1 Challenges Facing The Software Industry ............................................................................ 9
1.2 The Solution: Component Software ................................................................................... 11
1.3 The Component Software Solution: OLE’s COM .............................................................. 12
1.4 Objects and Interfaces ........................................................................................................ 19
1.5 Clients, Servers, and Object Implementors ........................................................................ 25
1.6 The COM Library............................................................................................................... 28
1.7 COM as a Foundation ........................................................................................................ 28
Part II: Component Object Model Programming Interface 32
2. Component Object Model Technical Overview 34
2.1 Objects and Interfaces ........................................................................................................ 34
2.2 COM Application Responsibilities ..................................................................................... 39
2.3 The COM Client/Server Model .......................................................................................... 40
2.4 Object Reusability .............................................................................................................. 47
2.5 Connectable Objects and Events ........................................................................................ 48
2.6 Persistent Storage ............................................................................................................... 49
2.7 Persistent, Intelligent Names: Monikers ............................................................................. 55
2.8 Uniform Data Transfer ....................................................................................................... 58
3. Objects And Interfaces 61
3.1 Interfaces ............................................................................................................................ 61
3.2 Globally Unique Identifiers ................................................................................................ 67
3.3 The IUnknown Interface .................................................................................................... 67
3.4 Error Codes and Error Handling ......................................................................................... 72
3.5 Enumerators and Enumerator Interfaces ............................................................................ 76
3.6 Designing and Implementing Objects ................................................................................... i
4. COM Applications 84
4.1 Verifying the COM Library Version .................................................................................. 84
4.2 Library Initialization / Uninitialization ............................................................................... 84
4.3 Memory Management ........................................................................................................ 85
4.4 Memory Allocation Example ............................................................................................. 88
5. COM Clients 90
5.1 Identifying the Object Class ............................................................................................... 90
5.2 Creating the Object............................................................................................................. 91
5.3 Obtaining the Class Factory Object for a CLSID .................................................................. i
5.4 Initializing the Object ............................................................................................................ i
5.5 Managing the Object .......................................................................................................... 98
5.6 Releasing the Object ......................................................................................................... 100
5.7 Server Management .......................................................................................................... 100
6. COM Servers 102
6.1 Identifying and Registering an Object Class .................................................................... 102
6.2 Implementing the Class Factory ....................................................................................... 105
6.3 Exposing the Class Factory .............................................................................................. 108
6.4 Providing for Server Unloading ....................................................................................... 112
6.5 Object Handlers ..................................................................................................................... i
6.6 Object Reusability ............................................................................................................ 115
6.7 Emulating Other Servers .................................................................................................. 120
7. Interface Remoting 124
7.1 How Interface Remoting Works ....................................................................................... 124
7.2 Architecture of Custom Object Marshaling ...................................................................... 125
7.3 Architecture of Standard Interface / Object Marshaling ................................................... 127
7.4 Architecture of Handler Marshaling ................................................................................. 130
7.5 Standards for Marshaled Data Packets ............................................................................. 131
7.6 Creating an Initial Connection Between Processes .......................................................... 131
7.7 Marshaling Interface and Function Descriptions .............................................................. 131
DRAFT: October 24, 1995 Page: 3 Copyright
ٛ
1992-95 Microsoft Corporation
All Rights Reserved
The Component Object Model Specification The Component Object Model
7.8 Marshaling - Related API Functions ................................................................................ 141
7.9 IMarshal interface ............................................................................................................ 145
7.10 IStdMarshalInfo interface ............................................................................................... 148
7.11 Support for Remote Debugging ...................................................................................... 149
8. Security 160
8.1 Activation Security ........................................................................................................... 160
8.2 Call Security ..................................................................................................................... 162
Part III: Component Object Model Protocols and Services 172
9. Connectable Objects 174
9.1 The IConnectionPoint Interface ....................................................................................... 174
9.2 The IConnectionPointContainer Interface ............................................................................ i
9.3 The IEnumConnectionPoints Interface ............................................................................ 178
9.4 The IEnumConnections Interface .......................................................................................... i
10. Persistent Storage 184
11. Persistent Intelligent Names: Monikers 186
11.1 Overview ........................................................................................................................ 186
11.2 IMoniker interface and Core Monikers .......................................................................... 187
11.2 ........................................................................................................................................ 187
12. Uniform Data Transfer 215
Part IV: Type Information 217
13. Interface Definition Language 219
13.1 Object RPC IDL Extensions ........................................................................................... 219
13.2 Mapping from ORPC IDL to DCE RPC IDL. ................................................................ 224
14. Type Libraries 227
Part V: The COM Library 229
15. Component Object Model Network Protocol 231
15.1 Overview ........................................................................................................................ 231
15.2 Data types and structures ................................................................................................ 235
15.3 IRemUnknown interface ................................................................................................ 242
15.4 The Object Exporter ............................................................................................................ i
15.4 ........................................................................................................................................ 245
15.5 Service Control Manager ..................................................................................................... i
15.6 Wrapping DCE RPC calls to interoperate with ORPC ................................................ 256
15.7 Implementing ORPC in RPC.......................................................................................... 257
Appendix B: Bibliography 260
Appendix C: Specification Revision History 262
Appendix D: Index 264
Copyright
ٛ
1992-95 Microsoft Corporation Page: 4 DRAFT: October 24, 1995
All Rights Reserved
The Component Object Model The Component Object Model Specification
How to Read This Document
This specification is written to help a variety of readers understand the design and implementation of the
Component Object Model (referred to herein simply as COM) as much as they would like. The presentation
of COM gradually progresses from high-level overviews to COM benefits and eventually into the underly-
ing mechanisms and programming interfaces to COM. This section is intended to help the reader determine
what parts of this document to read.
This specification is divided into four parts, each of which contains one or more chapters. Part I is an over-
view and introduction. Chapter 1, the only chapter in Part I, explains at a high level the motivations of
COM and the problems it addresses. It describes what COM is and its features, and describes the major
benefits and advantages of COM. All readers should be interested in this chapter.
Part II contains the programming interface to COM, the suite of interfaces and APIs by which Component
Object Model software is implemented and used. Chapters 2 through 8 are in Part II.
Chapter 2 goes into more detail about COM features and mechanisms without getting into the details of
function call specifications and code. The chapter is intended for technical readers who want to know more
than simply what COM is and what problems it solves, and therefore delves deeper into how applications
use COM and the benefits of such use.
Chapters 3-6 contain programming-level information for readers who are interested in actually making use
of COM in an application. These chapters explain the fundamentals of objects in COM and the creation of
object clients as well as object servers. Chapter 3 details the basic object structures and mechanisms and
provides the functional specifications of the core of COM. Chapter 4 covers the COM programming inter-
faces that all applications making use of COM must follow. Chapter 5 then deals specifically with COM
clients; Chapter 6 specifically with COM servers.
Chapter 7 contains more detailed information about how COM clients and servers communicate with ob-
jects. This information is generally needed only by sophisticated programmers. Nevertheless, program-
mers may find this chapter enlightening and can gain a clear understanding of all the underlying mechan-
isms that make COM truly powerful.
Chapter 8 contains information on how communications between COM clients and severs can be made
secure.
Part III (Chapters 9-12) provides the functional specifications for the extended features of COM, including
storage, naming, and exchange of data. These added features are built on top of the core COM functionality
described in the previous chapters.
Part IV specifies standards relating to tools used to assist the authorship of COM software. It includes
Chapter 13, which specifies the COM extensions to the standard Interface Definition Language (IDL) of
the Open Software Foundation (OSF) Distributed Computing Environment (DCE). This will be of interest
primarily to tools vendors who support tools that work with this language. Chapter 14 covers Type Libra-
ries which are the binary equivalent to IDL.
Finally, Part V specifies information needed by programmers who will be implementing COM on other
platforms—that is, the programmer who will be implementing COM on a systems level rather than an ap-
plication level. Within Part V, Chapter 15 specifies the protocol used by COM when performing distributed
computing between machines over a network. This chapter heavily references the OSF DCE RPC specifi-
cation, noted in the Bibliography as [CAE RPC].
DRAFT: October 24, 1995 Page: 5 Copyright
ٛ
1992-95 Microsoft Corporation
All Rights Reserved
剩余265页未读,继续阅读
LLLLLLLLLLLLLL265161
- 粉丝: 8
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功