SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
© Peter R. Egli 2015
1/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
Peter R. Egli
INDIGOO.COM
OVERVIEW OF MICROSOFTS COM, DCOM AND
COM+ COMPONENT TECHNOLOGIES
COM, DCOM,
COM+
© Peter R. Egli 2015
2/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
Contents
1. Evolution of COM
2. COM, DCOM, ActiveX, OLE, COM+
3. Structure of COM Components
4. (D)COM IUnknown Interface
5. Component Lookup and Access
6. Microsoft IDL File
7. Execution / Access Models
8. DCOM Architecture
9. COM/DCOM/COM+ Tools
10. Access (D)COM Objects from .Net (COM-.Net Interop)
11. COM+ Applications
12. Creation of COM Projects in Visual Studio
13. Limitations of COM
© Peter R. Egli 2015
3/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
1. Evolution of COM
Over time Microsoft enhanced and rebranded the
different object and integration technologies.
.Net is a technological break because it
is an entirely new technology.
DDE
1987
Dynamic Data Exchange.
 One of the first inter-process
communication means in Windows
Technology for compound
documents (e.g. Word document
with embedded Excel
document).
OLE
1990 1993 1995 1996 1998 2000
COM
DCOM
ActiveX
MTS
COM+Object Linking and Embedding.
 Based on DDE.
 Technology for embedding and
linking of documents in other
documents.
Component Object Model.
 Object technology
confined to single machines.
Distributed COM (COM over
RPC).
 Technology with
remotable objects.
 Microsoft‘s answer to
CORBA.
 Renamed part of OLE
related to networking.
 The parts of OLE relating
to compound documents
remained OLE.
Microsoft Transaction
Server.
 Runs on top of
COM/DCOM, but is not really
integrated with these
technologies.
 Introduced transaction
management, component
deployment and other
services.
 Fusing of COM/DCOM and
MTS plus additional
services.
 Uses COM as object
technology.
© Peter R. Egli 2015
4/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
2. What are COM, DCOM, ActiveX, OLE, COM+ ?
COM is Microsofts object / component technology.
DCOM = remote access to COM objects / components (wire protocol = MSRPC which is a
version of DCE RPC).
ActiveX/OLE uses COM as the underpinning. ActiveX / OLE provide additional services like
reusable / programmable controls (OCX – OLE Control Extensions), automation access
between office documents and in-process activation.
COM+ is the successor to the MTS/COM combo and provides a unified distributed
component/object technology including the transaction services of MTS.
COM+ uses the COM component specification and adds additional component services.
COM
ActiveX / OLE
MS RPC
MTS
COM+ COM
ActiveX / OLE
MS RPC
MTS
COM+
Client Server
DCOM
© Peter R. Egli 2015
5/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
3. Structure of COM Components
Relationship of objects, components, interfaces, classes, applications:
• A COM component contains 1..* objects.
• A COM component exists either as DLL (linked to the calling client, in-process) or as a
separately running executable (out-of-process server).
• A COM object implements 1..* interfaces which are defined in the IDL-file.
• All objects (classes) of a component make up a type library.
• Every object has an IUnknown interface (see below).
• Component type library, every interface and every class / object has a globally unique ID
(GUID, uuid).
COM Object
(CoDAO)
IUnknown
IDAO
IPersist
Component (DLL or exe)
COM Object
(CoViewer)
IUnknown
IViewer
uuid: FD4AD...4255B
uuid: A42B8...791BA uuid: 71AA0...25A4C
uuid: 09B4C... 4A746
uuid: 26B4D... D3C86
uuid: 8DA10...124BC
Type
library
Notation:
Client
Reference COM Object
Lollipop = (provided) interface.
Arrow = call of a method of on the
interface
© Peter R. Egli 2015
6/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
4. (D)COM IUnknown Interface
Every COM object has an IUnknown interface.
The IUnknown interface is used for:
a. Introspection / reflection:
Method QueryInterface() allows to dynamically discover other interfaces of an object (check
if an object supports a specific interface identified by an interface ID).
b. Life-cycle control / garbage collection (GC):
AddRef()  Client increases reference count.
Release()  Client releases its reference thus decrementing the reference count.
GC collects object once the reference count becomes 0.
COM Object
(CoViewer)
IUnknown
IViewer
COM Object
(CoDAO)
IUnknown
IDAO
IPersist
Component
(DLL or exe)
QueryInterface()
AddRef()
Release()
© Peter R. Egli 2015
7/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
5. Component Lookup and Access (1/3)
Objects are registered in the registry under HKEY_CLASSES_ROOT/CLSID.
Every object and interface has a registry entry.
The registry is consulted for locating (lookup) objects based on a ProgID (mapping of
GUID/uuid to implementation).
Location of server DLL containing the object class
Server type, here an inproc object (object is loaded into the client‘s process).
Alternative: LocalServer32 object running in an executable.
ProgID containing the version
Example „COMHelloWorld.COMHelloWorld.1“
ProgID without version
„COMHelloWorld.COMHelloWorld“
© Peter R. Egli 2015
8/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
5. Component Lookup and Access (2/3)
Clients contact the SCM (Service Control Manager) in order to obtain an object reference.
In case of remote objects (DCOM), the local SCM contacts the remote SCM.
Client
application
Server
Component
SCM
COM Object
Ixyz
1. Request with CLSID
(GUID, uuid)
Registry
2. Lookup
in registry
3. SCM instantiates
COM object
4. SCM passes
reference to
client
5. Call on COM
object
© Peter R. Egli 2015
9/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
5. Component Lookup and Access (3/3)
Problem of registry-based component lookup:
DLL-hell (different applications requiring different and possibly incompatible versions of
COM-libraries).
Solution:
Registry free creation of objects (requires Windows XP or higher). Also called „isolated COM“.
• Different applications may use different versions of COM-components.
• COM-components no longer need to be registered but may be deployed with XCOPY-
deployment (simple copying of components without creating registry entries by an installer).
• Component is described in a manifest file which is used by the calling application to load
and create the component.
Visual Studio settings (create manifest file as part of build):
Source: http://msdn.microsoft.com/de-ch/magazine/cc188708(en-us).aspx
© Peter R. Egli 2015
10/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
HelloWorld.cpp
6. Microsoft IDL File
IDL-files for COM use the MIDL-format (Microsoft IDL).
IDL files are compiled with MIDL.exe (automatically in Visual Studio ATL-project).
MIDL.exe
...
[
object,
uuid(FD4ADCD2-C7FC-466E-AD75-EBC03024255B),
dual,
nonextensible,
helpstring("ICOMHelloWorld Interface"),
pointer_default(unique)
]
interface ICOMHelloWorld : IDispatch{
[id(1), helpstring("method ShowMessage")] HRESULT ShowMessage(void);
[id(2), helpstring("method ShowMessageWithParam")] HRESULT ShowMessageWithParam([in] BSTR message);
};
...
COMHelloWorld.idl
...
public:
STDMETHOD(ShowMessage)(void);
public:
STDMETHOD(ShowMessageWithParam)(BSTR message);
};
...
HelloWorld.h
COMHelloWorld.h COMHelloWorld.cpp
© Peter R. Egli 2015
11/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
7. Execution / Access Models
In-proc access: Component resides in a DLL.
The client loads the component into its process.
Local server: Component resides in an executable and runs in its own process on the
local machine. Access through RPC.
Remote server: Component resides in an executable and runs on a remote machine.
Access through RPC.
COM Object
Client
COM
Local proxy
Remote
proxy
Client process
Client machine
COM
Stub
COM Object
RPC
Remote machine
COM
Stub
RPC
COM Object
In-process
access
Local
server
Remote
server
© Peter R. Egli 2015
12/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
8. DCOM Architecture
Client proxy: Proxy object on client side for accessing the server object.
Stub: Server interface stub that complements the client interface proxy.
Registry: Contains a list of mappings of class / object GUID to implementation library.
SCM: Service Control Manager (RPCSS.exe) which consults registry and creates /
instantiates a new server object based on the GUID (comparable to ORB in CORBA).
The SCM hides the registry from (D)COM.
COM Object
Interface
stub
SCM
COM Object
Interface
proxy
SCM Registry
Client Server
RPC RPC
Interface on SCM for
remote activation:
IRemoteActivation::
RemoteActivation
Client
component
library
Server
component
Actual access to
remote object is done
through RPC
ORB: Object Request Broker
© Peter R. Egli 2015
13/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
9. COM / DCOM / COM+ Tools
Register COM component:
regsvr32 <COM-lib>.dll
Registry of objects:
Windows registry (edit with regedit.exe or regedt32.exe)
Component service explorer:
Control Panel  Administrative Tools
 Component Services
or simply start dcomcnfg.exe
© Peter R. Egli 2015
14/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
10. Access (D)COM Objects from .Net (COM-.Net Interop)
.Net introduced an entirely new object model:
• .Net object lifetime is managed by garbage collector (COM: lifecycle controlled by client).
• .Net clients have far greater introspection possibilities through reflection.
• .Net objects reside in a managed environment (managed code).
The .Net environment (CLR: Common Language Runtime) provides wrappers for COM-.Net interoperability:
COM.Net: COM callable wrapper CCW .
.NetCOM: Runtime Callable Wrapper (RCW).
The wrappers are contained in DLLs called Interop.xxx.
Tasks of wrappers:
• Marshalling of parameters (e.g. MFC-type BSTR  .Net string)
• RCW: COM object reference counting (RCW); decreases reference count on COM object if object is no
longer needed on .Net managed side.
• .Net object reference release (CCW); map COM-side Release() call to .Net managed object release
Source: http://msdn.microsoft.com/en-us/library/5dxz80y2.aspx
COM .Net
© Peter R. Egli 2015
15/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
11. COM+ Applications
COM+ applications host (contain) 1..n COM-components.
Dcomcnfg.exe shows a list of active COM+ applications.
COM components
of „COM+ Utilities“ COM+
application
© Peter R. Egli 2015
16/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
12. Creation of COM Projects in Visual Studio (1/4)
1. Create Visual Studio ATL C++ project with the following settings:
2. Add a new class to the COM component:
© Peter R. Egli 2015
17/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
12. Creation of COM Projects in Visual Studio (2/4)
3. ATL Simple Object Wizard:
Set names (Class, Coclass and Interface names may be different):
4. Add method to interface (e.g. ShowMessage()):
© Peter R. Egli 2015
18/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
12. Creation of COM Projects in Visual Studio (3/4)
5. Implement interface method (ShowMessage()):
Add user code to implementation of method in implementation class (HelloWorld.cpp):
STDMETHODIMP CHelloWorld::ShowMessage(void)
{
::MessageBox(::GetActiveWindow( ),_T("Hello World from COMHelloWorld."),
_T("First COM+ Application"),MB_OK);
return S_OK;
}
6. Compile ATL COM project
7. Register COM:
Open command shell, change to debug directory of COM project.
>regsvr32.exe COMHelloWorld.dll
8. Create client, e.g. in Excel-VBA:
Create new Excel file
ToolsMacroVisual Basic Editor
Add reference to COM component (ToolsReferences):
© Peter R. Egli 2015
19/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
12. Creation of COM Projects in Visual Studio (4/4)
9. Access the COM component from VBA code:
'TestHelloClient_TLB accesses the COM component using the COM type library (TLB)
'that has to be added to this project in the references (Menu Tools->References)
Sub TestHelloWorldClient_TLB()
Dim hw As COMHelloWorld
Dim gw As COMGoodbyeWorld
Set hw = New COMHelloWorld
hw.ShowMessage
Set gw = New COMGoodbyeWorld
gw.ShowMessage
End Sub
'TestHelloWorldClient_ProgID access the COM component using the ProgID
Sub TestHelloWorldClient_ProgID()
Dim obj As Object
Set obj = CreateObject("COMHelloWorld.COMHelloWorld")
obj.ShowMessage
Set obj = CreateObject("COMHelloWorld.COMGoodbyeWorld")
obj.ShowMessage
End Sub
ATL project name Coclass name
Object ProgID
© Peter R. Egli 2015
20/20
Rev. 1.60
COM – DCOM - COM+ indigoo.com
13. Limitations of COM
COM is still widely used by many applications to provide programmatic access for automation
purposes.
However, due to many technological limitations (see below) COM was technologically
superseded by .Net.
No true inheritance (may be emulated with aggregation and containment).
No exceptions (only return codes).
Inconsistent use of IDL (COM uses IDL, but VB or scripting languages like VBA use binary
representation (type library)).
No OO-features (static modifier, virtual functions, overloaded methods).

Contenu connexe

Tendances

Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET FrameworkRoshith S Pai
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingramyaaswin
 
Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer ArchitectureAbu Zaman
 
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...Bhavin Darji
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net frameworkThen Murugeshwari
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagramRahul Pola
 
3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cflSampath Kumar S
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineeringMubashir Jutt
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lexAnusuya123
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity DiagramNiloy Rocker
 
L attribute in compiler design
L  attribute in compiler designL  attribute in compiler design
L attribute in compiler designkhush_boo31
 

Tendances (20)

Components of .NET Framework
Components of .NET FrameworkComponents of .NET Framework
Components of .NET Framework
 
Groupware
GroupwareGroupware
Groupware
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
4.C#
4.C#4.C#
4.C#
 
Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer Architecture
 
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...
Overview of Language Processor : Fundamentals of LP , Symbol Table , Data Str...
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Architecture of .net framework
Architecture of .net frameworkArchitecture of .net framework
Architecture of .net framework
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Pass Structure of Assembler
Pass Structure of AssemblerPass Structure of Assembler
Pass Structure of Assembler
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lex
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Uml Activity Diagram
Uml Activity DiagramUml Activity Diagram
Uml Activity Diagram
 
L attribute in compiler design
L  attribute in compiler designL  attribute in compiler design
L attribute in compiler design
 

En vedette

Dcom vs. corba
Dcom vs. corbaDcom vs. corba
Dcom vs. corbaMohd Arif
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corbaMayuresh Wadekar
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecturenupurmakhija1211
 
Como crear Clientes/Servidores en COM-DCOM
Como crear Clientes/Servidores en COM-DCOMComo crear Clientes/Servidores en COM-DCOM
Como crear Clientes/Servidores en COM-DCOMEliana Ruiz
 
Multi-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile RobotsMulti-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile RobotsJun Kato
 
Giáo trình lập trình GDI+
Giáo trình lập trình GDI+Giáo trình lập trình GDI+
Giáo trình lập trình GDI+Sự Phạm Thành
 
Restful web service
Restful web serviceRestful web service
Restful web servicesunguen lee
 
AXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systemsAXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systemsRemedy IT
 

En vedette (20)

COM and DCOM
COM and DCOMCOM and DCOM
COM and DCOM
 
Dcom vs. corba
Dcom vs. corbaDcom vs. corba
Dcom vs. corba
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Corba concepts & corba architecture
Corba concepts & corba architectureCorba concepts & corba architecture
Corba concepts & corba architecture
 
DCOM
DCOMDCOM
DCOM
 
DCOM Comparison
DCOM ComparisonDCOM Comparison
DCOM Comparison
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Evolution of com
Evolution of comEvolution of com
Evolution of com
 
Unit 6 dcom
Unit 6 dcom   Unit 6 dcom
Unit 6 dcom
 
Como crear Clientes/Servidores en COM-DCOM
Como crear Clientes/Servidores en COM-DCOMComo crear Clientes/Servidores en COM-DCOM
Como crear Clientes/Servidores en COM-DCOM
 
Com
ComCom
Com
 
Dcom visualC++
Dcom visualC++Dcom visualC++
Dcom visualC++
 
Distributed system
Distributed systemDistributed system
Distributed system
 
Corba model ppt
Corba model pptCorba model ppt
Corba model ppt
 
Multi-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile RobotsMulti-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile Robots
 
Giáo trình lập trình GDI+
Giáo trình lập trình GDI+Giáo trình lập trình GDI+
Giáo trình lập trình GDI+
 
Restful web service
Restful web serviceRestful web service
Restful web service
 
AXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systemsAXCIOMA, the component framework for distributed, real-time and embedded systems
AXCIOMA, the component framework for distributed, real-time and embedded systems
 

Similaire à Component Object Model (COM, DCOM, COM+)

MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363mokacao
 
Component based software development
Component based software developmentComponent based software development
Component based software developmentEmmanuel Fuchs
 
AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...Remedy IT
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...Remedy IT
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Microsoft.Net Platform Basics
Microsoft.Net Platform BasicsMicrosoft.Net Platform Basics
Microsoft.Net Platform Basicsnithinmohantk
 
The .net remote systems
The .net remote systemsThe .net remote systems
The .net remote systemsRaghu nath
 
WIndows Embedded Compact 2013 – What’s news
WIndows Embedded Compact 2013 – What’s newsWIndows Embedded Compact 2013 – What’s news
WIndows Embedded Compact 2013 – What’s newsMirco Vanini
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
Qtp not just for gui anymore
Qtp   not just for gui anymoreQtp   not just for gui anymore
Qtp not just for gui anymorePragya Rastogi
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp EnGregory Renard
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introductionnandhu8124
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET PlatformPeter R. Egli
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminarcontest-theta360
 

Similaire à Component Object Model (COM, DCOM, COM+) (20)

CFInterop
CFInteropCFInterop
CFInterop
 
MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363
 
Component based software development
Component based software developmentComponent based software development
Component based software development
 
AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
COM
COMCOM
COM
 
AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...AXCIOMA, the internals, the component framework for distributed, real-time, a...
AXCIOMA, the internals, the component framework for distributed, real-time, a...
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Microsoft.Net Platform Basics
Microsoft.Net Platform BasicsMicrosoft.Net Platform Basics
Microsoft.Net Platform Basics
 
The .net remote systems
The .net remote systemsThe .net remote systems
The .net remote systems
 
Session 1
Session 1Session 1
Session 1
 
WIndows Embedded Compact 2013 – What’s news
WIndows Embedded Compact 2013 – What’s newsWIndows Embedded Compact 2013 – What’s news
WIndows Embedded Compact 2013 – What’s news
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Qtp not just for gui anymore
Qtp   not just for gui anymoreQtp   not just for gui anymore
Qtp not just for gui anymore
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp En
 
DOTNET
DOTNETDOTNET
DOTNET
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET Platform
 
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 RICOH THETA x IoT Developers Contest : Cloud API Seminar RICOH THETA x IoT Developers Contest : Cloud API Seminar
RICOH THETA x IoT Developers Contest : Cloud API Seminar
 

Plus de Peter R. Egli

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosPeter R. Egli
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking ConceptsPeter R. Egli
 
Communication middleware
Communication middlewareCommunication middleware
Communication middlewarePeter R. Egli
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Peter R. Egli
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Peter R. Egli
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud ComputingPeter R. Egli
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingPeter R. Egli
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development KitPeter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Peter R. Egli
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBAPeter R. Egli
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging ServicePeter R. Egli
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Peter R. Egli
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented MiddlewarePeter R. Egli
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 

Plus de Peter R. Egli (20)

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking Concepts
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Web services
Web servicesWeb services
Web services
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)Web Services (SOAP, WSDL, UDDI)
Web Services (SOAP, WSDL, UDDI)
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
MOM - Message Oriented Middleware
MOM - Message Oriented MiddlewareMOM - Message Oriented Middleware
MOM - Message Oriented Middleware
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 

Dernier

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 

Dernier (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 

Component Object Model (COM, DCOM, COM+)

  • 1. © Peter R. Egli 2015 1/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com Peter R. Egli INDIGOO.COM OVERVIEW OF MICROSOFTS COM, DCOM AND COM+ COMPONENT TECHNOLOGIES COM, DCOM, COM+
  • 2. © Peter R. Egli 2015 2/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com Contents 1. Evolution of COM 2. COM, DCOM, ActiveX, OLE, COM+ 3. Structure of COM Components 4. (D)COM IUnknown Interface 5. Component Lookup and Access 6. Microsoft IDL File 7. Execution / Access Models 8. DCOM Architecture 9. COM/DCOM/COM+ Tools 10. Access (D)COM Objects from .Net (COM-.Net Interop) 11. COM+ Applications 12. Creation of COM Projects in Visual Studio 13. Limitations of COM
  • 3. © Peter R. Egli 2015 3/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 1. Evolution of COM Over time Microsoft enhanced and rebranded the different object and integration technologies. .Net is a technological break because it is an entirely new technology. DDE 1987 Dynamic Data Exchange.  One of the first inter-process communication means in Windows Technology for compound documents (e.g. Word document with embedded Excel document). OLE 1990 1993 1995 1996 1998 2000 COM DCOM ActiveX MTS COM+Object Linking and Embedding.  Based on DDE.  Technology for embedding and linking of documents in other documents. Component Object Model.  Object technology confined to single machines. Distributed COM (COM over RPC).  Technology with remotable objects.  Microsoft‘s answer to CORBA.  Renamed part of OLE related to networking.  The parts of OLE relating to compound documents remained OLE. Microsoft Transaction Server.  Runs on top of COM/DCOM, but is not really integrated with these technologies.  Introduced transaction management, component deployment and other services.  Fusing of COM/DCOM and MTS plus additional services.  Uses COM as object technology.
  • 4. © Peter R. Egli 2015 4/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 2. What are COM, DCOM, ActiveX, OLE, COM+ ? COM is Microsofts object / component technology. DCOM = remote access to COM objects / components (wire protocol = MSRPC which is a version of DCE RPC). ActiveX/OLE uses COM as the underpinning. ActiveX / OLE provide additional services like reusable / programmable controls (OCX – OLE Control Extensions), automation access between office documents and in-process activation. COM+ is the successor to the MTS/COM combo and provides a unified distributed component/object technology including the transaction services of MTS. COM+ uses the COM component specification and adds additional component services. COM ActiveX / OLE MS RPC MTS COM+ COM ActiveX / OLE MS RPC MTS COM+ Client Server DCOM
  • 5. © Peter R. Egli 2015 5/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 3. Structure of COM Components Relationship of objects, components, interfaces, classes, applications: • A COM component contains 1..* objects. • A COM component exists either as DLL (linked to the calling client, in-process) or as a separately running executable (out-of-process server). • A COM object implements 1..* interfaces which are defined in the IDL-file. • All objects (classes) of a component make up a type library. • Every object has an IUnknown interface (see below). • Component type library, every interface and every class / object has a globally unique ID (GUID, uuid). COM Object (CoDAO) IUnknown IDAO IPersist Component (DLL or exe) COM Object (CoViewer) IUnknown IViewer uuid: FD4AD...4255B uuid: A42B8...791BA uuid: 71AA0...25A4C uuid: 09B4C... 4A746 uuid: 26B4D... D3C86 uuid: 8DA10...124BC Type library Notation: Client Reference COM Object Lollipop = (provided) interface. Arrow = call of a method of on the interface
  • 6. © Peter R. Egli 2015 6/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 4. (D)COM IUnknown Interface Every COM object has an IUnknown interface. The IUnknown interface is used for: a. Introspection / reflection: Method QueryInterface() allows to dynamically discover other interfaces of an object (check if an object supports a specific interface identified by an interface ID). b. Life-cycle control / garbage collection (GC): AddRef()  Client increases reference count. Release()  Client releases its reference thus decrementing the reference count. GC collects object once the reference count becomes 0. COM Object (CoViewer) IUnknown IViewer COM Object (CoDAO) IUnknown IDAO IPersist Component (DLL or exe) QueryInterface() AddRef() Release()
  • 7. © Peter R. Egli 2015 7/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 5. Component Lookup and Access (1/3) Objects are registered in the registry under HKEY_CLASSES_ROOT/CLSID. Every object and interface has a registry entry. The registry is consulted for locating (lookup) objects based on a ProgID (mapping of GUID/uuid to implementation). Location of server DLL containing the object class Server type, here an inproc object (object is loaded into the client‘s process). Alternative: LocalServer32 object running in an executable. ProgID containing the version Example „COMHelloWorld.COMHelloWorld.1“ ProgID without version „COMHelloWorld.COMHelloWorld“
  • 8. © Peter R. Egli 2015 8/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 5. Component Lookup and Access (2/3) Clients contact the SCM (Service Control Manager) in order to obtain an object reference. In case of remote objects (DCOM), the local SCM contacts the remote SCM. Client application Server Component SCM COM Object Ixyz 1. Request with CLSID (GUID, uuid) Registry 2. Lookup in registry 3. SCM instantiates COM object 4. SCM passes reference to client 5. Call on COM object
  • 9. © Peter R. Egli 2015 9/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 5. Component Lookup and Access (3/3) Problem of registry-based component lookup: DLL-hell (different applications requiring different and possibly incompatible versions of COM-libraries). Solution: Registry free creation of objects (requires Windows XP or higher). Also called „isolated COM“. • Different applications may use different versions of COM-components. • COM-components no longer need to be registered but may be deployed with XCOPY- deployment (simple copying of components without creating registry entries by an installer). • Component is described in a manifest file which is used by the calling application to load and create the component. Visual Studio settings (create manifest file as part of build): Source: http://msdn.microsoft.com/de-ch/magazine/cc188708(en-us).aspx
  • 10. © Peter R. Egli 2015 10/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com HelloWorld.cpp 6. Microsoft IDL File IDL-files for COM use the MIDL-format (Microsoft IDL). IDL files are compiled with MIDL.exe (automatically in Visual Studio ATL-project). MIDL.exe ... [ object, uuid(FD4ADCD2-C7FC-466E-AD75-EBC03024255B), dual, nonextensible, helpstring("ICOMHelloWorld Interface"), pointer_default(unique) ] interface ICOMHelloWorld : IDispatch{ [id(1), helpstring("method ShowMessage")] HRESULT ShowMessage(void); [id(2), helpstring("method ShowMessageWithParam")] HRESULT ShowMessageWithParam([in] BSTR message); }; ... COMHelloWorld.idl ... public: STDMETHOD(ShowMessage)(void); public: STDMETHOD(ShowMessageWithParam)(BSTR message); }; ... HelloWorld.h COMHelloWorld.h COMHelloWorld.cpp
  • 11. © Peter R. Egli 2015 11/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 7. Execution / Access Models In-proc access: Component resides in a DLL. The client loads the component into its process. Local server: Component resides in an executable and runs in its own process on the local machine. Access through RPC. Remote server: Component resides in an executable and runs on a remote machine. Access through RPC. COM Object Client COM Local proxy Remote proxy Client process Client machine COM Stub COM Object RPC Remote machine COM Stub RPC COM Object In-process access Local server Remote server
  • 12. © Peter R. Egli 2015 12/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 8. DCOM Architecture Client proxy: Proxy object on client side for accessing the server object. Stub: Server interface stub that complements the client interface proxy. Registry: Contains a list of mappings of class / object GUID to implementation library. SCM: Service Control Manager (RPCSS.exe) which consults registry and creates / instantiates a new server object based on the GUID (comparable to ORB in CORBA). The SCM hides the registry from (D)COM. COM Object Interface stub SCM COM Object Interface proxy SCM Registry Client Server RPC RPC Interface on SCM for remote activation: IRemoteActivation:: RemoteActivation Client component library Server component Actual access to remote object is done through RPC ORB: Object Request Broker
  • 13. © Peter R. Egli 2015 13/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 9. COM / DCOM / COM+ Tools Register COM component: regsvr32 <COM-lib>.dll Registry of objects: Windows registry (edit with regedit.exe or regedt32.exe) Component service explorer: Control Panel  Administrative Tools  Component Services or simply start dcomcnfg.exe
  • 14. © Peter R. Egli 2015 14/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 10. Access (D)COM Objects from .Net (COM-.Net Interop) .Net introduced an entirely new object model: • .Net object lifetime is managed by garbage collector (COM: lifecycle controlled by client). • .Net clients have far greater introspection possibilities through reflection. • .Net objects reside in a managed environment (managed code). The .Net environment (CLR: Common Language Runtime) provides wrappers for COM-.Net interoperability: COM.Net: COM callable wrapper CCW . .NetCOM: Runtime Callable Wrapper (RCW). The wrappers are contained in DLLs called Interop.xxx. Tasks of wrappers: • Marshalling of parameters (e.g. MFC-type BSTR  .Net string) • RCW: COM object reference counting (RCW); decreases reference count on COM object if object is no longer needed on .Net managed side. • .Net object reference release (CCW); map COM-side Release() call to .Net managed object release Source: http://msdn.microsoft.com/en-us/library/5dxz80y2.aspx COM .Net
  • 15. © Peter R. Egli 2015 15/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 11. COM+ Applications COM+ applications host (contain) 1..n COM-components. Dcomcnfg.exe shows a list of active COM+ applications. COM components of „COM+ Utilities“ COM+ application
  • 16. © Peter R. Egli 2015 16/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 12. Creation of COM Projects in Visual Studio (1/4) 1. Create Visual Studio ATL C++ project with the following settings: 2. Add a new class to the COM component:
  • 17. © Peter R. Egli 2015 17/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 12. Creation of COM Projects in Visual Studio (2/4) 3. ATL Simple Object Wizard: Set names (Class, Coclass and Interface names may be different): 4. Add method to interface (e.g. ShowMessage()):
  • 18. © Peter R. Egli 2015 18/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 12. Creation of COM Projects in Visual Studio (3/4) 5. Implement interface method (ShowMessage()): Add user code to implementation of method in implementation class (HelloWorld.cpp): STDMETHODIMP CHelloWorld::ShowMessage(void) { ::MessageBox(::GetActiveWindow( ),_T("Hello World from COMHelloWorld."), _T("First COM+ Application"),MB_OK); return S_OK; } 6. Compile ATL COM project 7. Register COM: Open command shell, change to debug directory of COM project. >regsvr32.exe COMHelloWorld.dll 8. Create client, e.g. in Excel-VBA: Create new Excel file ToolsMacroVisual Basic Editor Add reference to COM component (ToolsReferences):
  • 19. © Peter R. Egli 2015 19/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 12. Creation of COM Projects in Visual Studio (4/4) 9. Access the COM component from VBA code: 'TestHelloClient_TLB accesses the COM component using the COM type library (TLB) 'that has to be added to this project in the references (Menu Tools->References) Sub TestHelloWorldClient_TLB() Dim hw As COMHelloWorld Dim gw As COMGoodbyeWorld Set hw = New COMHelloWorld hw.ShowMessage Set gw = New COMGoodbyeWorld gw.ShowMessage End Sub 'TestHelloWorldClient_ProgID access the COM component using the ProgID Sub TestHelloWorldClient_ProgID() Dim obj As Object Set obj = CreateObject("COMHelloWorld.COMHelloWorld") obj.ShowMessage Set obj = CreateObject("COMHelloWorld.COMGoodbyeWorld") obj.ShowMessage End Sub ATL project name Coclass name Object ProgID
  • 20. © Peter R. Egli 2015 20/20 Rev. 1.60 COM – DCOM - COM+ indigoo.com 13. Limitations of COM COM is still widely used by many applications to provide programmatic access for automation purposes. However, due to many technological limitations (see below) COM was technologically superseded by .Net. No true inheritance (may be emulated with aggregation and containment). No exceptions (only return codes). Inconsistent use of IDL (COM uses IDL, but VB or scripting languages like VBA use binary representation (type library)). No OO-features (static modifier, virtual functions, overloaded methods).