CSC Proprietary 9/11/2015 2:16:16 AM 008_P2_CSC_white 1.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Qisheng Hong Yani Mulyani Paul Visokey
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
COM vs. CORBA.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Technical Architectures
Hadar Vorenshtein & Meital Levy Instructor yavgeni Rivkin.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Practical Issues of RPCCS-4513, D-Term Remote Procedure Call Practical Issues CS-4513 Distributed Computing Systems (Slides include materials from.
Communication in Distributed Systems –Part 2
Object Based Operating Systems1 Learning Objectives Object Orientation and its benefits Controversy over object based operating systems Object based operating.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
INTRODUCTION TO WEB DATABASE PROGRAMMING
DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among.
DCOM Technology Şevket Duran Haşim Sak.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
Threading Models in Visual Basic Language Student Name: Danyu Xu Student ID:98044.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture 15 Introduction to Web Services Web Service Applications.
‘Tirgul’ # 7 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #7.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
Introduction to COM and DCOM Organizational Communications and Technologies Prithvi N. Rao H. John Heinz III School of Public Policy and Management Carnegie.
CS 603 DCOM April 5, DCOM – What is it? Start with COM – Component Object Model –Language-independent object interface Add interprocess communication.
COMCOM omponent bject odel After this presentation, you will: Be Able To: Conceptual understanding of COM How it works, What it’s used for Decode Acronyms.
Information Management NTU Interprocess Communication and Middleware.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
OOMI From COM to DCOM.
Ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software.
Introduction to COM and ActiveX Controls. What is an object? In the Fayad sense of the word.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved RPC Tanenbaum.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
OOMI A short introduction to Microsoft's COM From COM to DCOM.
GAM666 – Introduction To Game Programming ● DirectX is implemented as a collection of COM objects ● To use a DirectX program, the user must have the correct.
Eric Tryon Brian Clark Christopher McKeowen. System Architecture The architecture can be broken down to three different basic layers Stub/skeleton layer.
Remote Procedure Call RPC
COM / DCOM Xiaolan Lu Mingzhen Wang Dong Xie. Why COM / DCOM?  Challenges facing the software industry  Component software provides a solution  General.
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
.NET Mobile Application Development XML Web Services.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
A service Oriented Architecture & Web Service Technology.
Component Object Model(COM)
Apartments and COM Threading Models
What is RMI? Remote Method Invocation
Out-of-Process Components
Programming Models for Distributed Application
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Interpreter Style Examples
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Out-of-Process Components
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Presented By Justas Raslanas
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

CSC Proprietary 9/11/2015 2:16:16 AM 008_P2_CSC_white 1

CSC Proprietary 9/11/2015 2:16:16 AM 008_fmt_wht 2 COM

CSC India 3 Before COM DLL with exported functions Windows API Dynamic data exchange Procedural programming

CSC India 4 From DLLs to COM Interoperability Versioning Language independence Transparent cross-process interoperability

CSC India 5 From DLLs to COM New generation requires applications, content, operating systems, networking, distributed services to be integrated as never before Monolithic solutions won’t work –No one vendor or one team of programmers can move fast enough –Need to leverage others’ work and to build and ship smaller pieces incrementally –Need to evolve smaller pieces asynchronously without sacrificing the whole

CSC India 6 Component Object Model * Components, Components, Components Binary standard Wire-level standard

CSC India 7 Examples Manufacturing process control Controls on the Internet/Intranet client Component based server applications –Active Server Pages –Microsoft Transaction Server (Viper) Multi-tier “client/server” applications

CSC India 8 3 Tier Client/Server Third-Tier - Databases, Legacy Data COMCOM SNA etc... CORBA Mid-Tier - HTTP, Biz Objects, Active Server Pages, Scripting COMCOM HTTPHTTP “Desktop” - Compound Documents, Controls, Scripting

CSC India 9 Interface based Programming An interface, defines a set of public methods without including any implementation. An object has an interface and outer world interacts only with the interfaces. With out interface object has no existence. Object “XYZ” Interface A1’

CSC India 10 COM Fundamentals A binary standard for function calling between components. A provision for strongly-typed groupings of functions into interfaces. A base interface providing: A way for components to dynamically discover the interfaces implemented by other components. Reference counting to allow components to track their own lifetime and delete themselves when appropriate

CSC India 11 COM Fundamentals A mechanism to uniquely identify components and their interfaces. A "component loader" to set up component interactions and additionally in the cross-process and cross-network cases to help manage component interactions.

CSC India 12 Binary Standard Standard way to lay out virtual function tables (vtables). Standard way to call functions through the vtables. An interface is actually a pointer to a vtable

CSC India 13 The Rules of the Component Object Model Rule: Must Implement IUnknown An object is not a Microsoft Component Object Model (COM) object unless it implements at least one interface that at minimum is IUnknown. COM defines one special interface, IUnknown, to implement some essential functionality

CSC India 14 The Rules of the Component Object Model IUnknown has three methods: –QueryInterface – AddRef – Release interface IUnknown{ virtual HRESULT QueryInterface(IID& iid, void** ppvObj) = 0; virtual ULONG AddRef() = 0; virtual ULONG Release() = 0; }

CSC India 15 The Rules of the Component Object Model QueryInterface COM Object Hi do you have a mobile phone ? Yes It is 9811xxxxx

CSC India 16 The Rules of the Component Object Model QueryInterface COM Object Interface X supported? Return pointer to Interface X Error Y Not Supported Interface Y supported?

CSC India 17 The Rules of the Component Object Model AddRef and Release are simple reference counting methods. A component object's AddRef method is called when another component object is using the interface; the component object's Release method is called when the other component no longer requires use of that interface.

CSC India 18 Globally Unique Identifiers Need to be identify interface uniquely. –Human readable names have risk and probability of collision almost 100% COM uses globally unique identifiers (GUIDs)-128-bit integers that are virtually guaranteed to be unique in the world across space and time-to identify every interface and every object class.

CSC India 19 Globally Unique Identifiers a GUID is a data structure defined as follows, where DWORD is 32-bits, WORD is 16-bits, and BYTE is 8- bits: typedef struct GUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } GUID;

CSC India 20 Globally Unique Identifiers Each COM interface has an associated GUID called an interface ID (IID) Each Component (Class) has an associated GUID called a class ID (CLSID).

CSC India 21 COM Interfaces An interface is not a class An interface is not an object Interfaces are strongly typed Interfaces are immutable

CSC India 22 Clients, Servers, and Object Implementers interaction between objects and the users of those objects in COM is based on a client/server model. A client that uses the services of an object is referred as client. An object supplies services, the implementer of that object is usually called the server

CSC India 23 Clients, Servers, and Object Object Client Server

CSC India 24 Object A unit of functionality that implements one or more interfaces to expose that functionality. For convenience, the word is used both to refer to an object class as well as an individual instantiation of a class. Note that an object class does not need a class identifier in the COM sense such that other applications can instantiate objects of that class—the class used to implement the object internally has no bearing on the externally visible COM class identifier.

CSC India 25 Client Any piece of code that is using the services of some object, wherever that object might be implemented An application that drives the flow of operation between itself an other objects and uses specific COM implementation locator services to instantiate or create objects through servers of various object classes.

CSC India 26 Server A piece of code that structures an object class in a specific fashion and assigns that class a COM class identifier. This enables a client to pass the class identifier to COM and ask for an object of that class. COM is able to load and run the server code, ask the server to create an object of the class, and connect that new object to the client. A server is specifically the necessary structure around an object that serves the object to the rest of the system and associates the class identifier: a server is not the object itself. The word server is used in discussions to emphasize the serving agent more than the object.

CSC India 27 Configuration

CSC India 28 Server : In-Process and Out-Of-Process Server in general is some piece of code that structures some object in such a way that COM implementer locator services can run that code and have it create objects –In-Process Server –Local Server –Remote Server

CSC India 29 In-Process Server A server that can be loaded into the client's process space and serves in-process objects. Typically these are implemented as dynamic link libraries or DLLs.

CSC India 30 Local Server A server that runs in a separate process on the same computer as the client and serves local objects. This type of server is another complete application of its own thus defining the separate process.

CSC India 31 Remote Server A server that runs on a separate computer and therefore always runs in another process as well to serve remote objects. Remote servers may be implemented in either.DLLs or.EXEs; if a remote server is implemented in a.DLL, a surrogate process will be created for it on the remote computer.

CSC India 32 Location Transparency COM is designed to allow clients to transparently communicate with objects regardless of where those objects are running, be it the same process, the same computer, or a different computer

CSC India 33

CSC India 34 COM Library In addition to being a specification, COM is also an implementation contained what is called The COM Library.

CSC India 35 COM Library A small number of fundamental API functions that facilitate the creation of COM applications, both clients and servers. For clients, COM supplies basic object creation functions; for servers the facilities to expose their objects.

CSC India 36 COM Library Implementation locator services through which COM determines from a class identifier which server implements that class and where that server is located. This includes support for a level of indirection, usually a system registry, between the identity of an object class and the packaging of the implementation such that clients are independent of the packaging which can change in the future.

CSC India 37 COM Library Transparent remote procedure calls when an object is running in a local or remote server. A standard mechanism to allow an application to control how memory is allocated within its process.

CSC India 38 COM Library Transparent remote procedure calls when an object is running in a local or remote server. A standard mechanism to allow an application to control how memory is allocated within its process.

CSC India 39 COM Architecture Component COM run time provider Security RPC RPC COM run time Security provider RPC RPC Protocol stack DCOM network- protocol Remote Client

CSC India 40 Distributed COM Just COM “with a longer wire” All COM components communicate in the same way –on the same machine In-process, Out-of-process –across a Local Area Network –across a Wide Area Network –across the Internet

CSC India 41 COM Runtime Architecture Pluggable Transports COM Client Component COM Runtime Server MachineClient Machine TCP, UDP SPX,IPX Net BUI HTTP “Falcon” COM Runtime Proxy Other Component

CSC India 42 Processes, Apartments, and Threads A process is a collection of virtual memory space, code, data, and system resources A thread is code that is to be serially executed within a process the simplest way to view COM’s threading architecture is to think of all the COM objects in the process as divided into groups called apartments

CSC India 43 Processes, Apartments, and Threads Every COM object is owned by an apartment. A given thread can execute in only one apartment at a time COM recognizes two kinds of apartment –Single-Threaded Apartment (STA) –Multi-Threaded Apartment (MTA).

CSC India 44 Single-threaded Apartments Each thread that uses Object in a separate “apartment”, and COM synchronizes all incoming calls with the windows message queue. A process with a single thread of execution is simply a special case of this model.

CSC India 45 Multi-threaded Apartments Multiple threads in a single free-threaded apartment use COM and calls to COM objects are synchronized by the objects themselves

CSC India 46 vTable as a Standard In-Memory Representation

CSC India 47 Type Libraries and Language Independence In COM, clients and objects communicate through vTable binding. Clients and objects must be savvy in their use of function pointers What about Visual Basic which does not have any built in support for function pointers?

CSC India 48 Type Libraries and Language Independence Visual Basic provides this assistance by adding support to its compiler and adding a Visual Basic-to-COM mapping layer in its runtime. On the client side, the Visual Basic compiler automatically creates the vTable binding code required to access a COM object.

CSC India 49 Type Libraries and Language Independence As Visual Basic uses a mapping layer, it hides many of the underlying details from its programmers. The Visual Basic compiler can't make sense of a C++ header file. Therefore, it can't use an abstract base class at compile time to build the client-side binding code.

CSC India 50 Type Libraries and Language Independence Visual Basic uses interface definitions that are published inside a special type of file called a type library. The type library tells the Visual Basic compiler what the vTable for each interface looks like

CSC India 51 Type Library A type library is a binary repository that contains type information about such things as interfaces and components. It's essentially a catalog that defines a collection of COM data type.

CSC India 52 Type Library Inside a type library, each interface is defined as a set of methods; each component is defined as a set of one or more implemented interfaces.

CSC India 53 ActiveX? A marketing name for a set of technologies and services, all based on COM (the model and the services)

CSC India 54 Active Components in Visual Basic ActiveX Control ActiveX DLL ActiveX Exe ActiveX Document Active Components that can be created by Visual Basic are basically COM Servers.

CSC India 55 Active Components in Visual Basic When a programmer compiles an ActiveX DLL or an ActiveX EXE, Visual Basic automatically creates a type library for the programmer and bundles it into the server's executable image. This type library contains definitions for the components (coclasses) provided by the server and a definition for each interface defined in the server's project

CSC India 56 Interface Definition Language Type libraries can be built using a special language called Interface Definition Language (IDL) While type libraries define interfaces and coclasses in a binary format, IDL does the same thing in a readable text-based format

CSC India 57 Interface Definition Language library DogServerLib { interface IDog { HRESULT Bark(); HRESULT RollOver([in] int Rolls); }; interface IwonderDog { HRESULT FetchSlippers(); }; coclass CBeagle { interface IDog; interface IWonderDog; }; };

CSC India 58 Type Library [uuid(3B46B8A8-CA17-11D1-920B ) ] interface _IDog { // methods }; [ uuid(3B46B8AB-CA17-11D1-920B ) ] coclass CBeagle { // interfaces }; };

CSC India 59 Automation A scripting client can't read an interface definition from a type library, it can't generate the required client-side binding code to access the vTables associated with a COM object. (Example VBScript and JavaScript) These clients still have a way to invoke methods in a special type of object known as an automation object. An automation object is an object that implements a special interface named IDispatch.

CSC India 60 IDispatch Automation relies on an interface named IDispatch, which allows clients to create method bindings at runtime in a process known as late binding. IDispatch extends IUnknown by adding four methods –GetIDsOfNames() –GetTypeInfoCount() –GetTypeInfo() –Invoke()

CSC India 61 IDispatch

CSC India 62 Automation and Late Binding Automation clients use the two methods GetIDsOfNames and Invoke to achieve late binding. After a client receives an IDispatch reference, it can ask an object whether it supports a particular method by calling GetIDsOfNames. If the object doesn't support the requested method, the call to GetIDsOfNames fails. If the method is supported, GetIDsOfNames returns a logical identifier for the method called a DISPID.

CSC India 63 Automation and Late Binding A DISPID is simply an integer that an object provides to identify one of its methods. Positive DISPIDs indicate that a method is user-defined, while negative DISPIDs are reserved for methods with special purposes. A client armed with a valid DISPID can execute a method through automation by calling Invoke. Invoke is the only way to execute a user-defined method through the IDispatch interface.

CSC India 64 Automation and Late Binding Late binding is great for clients that can't deal with direct vTable binding, but it offers pretty slow execution times compared with direct vTable binding. A Visual Basic client can access an automation object through IDispatch by using the Object data type.

CSC India 65 Dual Interfaces A dual interface is a hybrid interface of two earlier type of interfaces (One who reads from vTable and another that uses the late binding) The vTable behind a dual interface contains user- defined methods in addition to the methods of IDispatch. Clients can access a dual interface either through direct vTable binding or through late binding.

CSC India 66 Dual Interfaces

CSC India 67 Dual Interfaces Visual Basic objects can cater to both custom vTable- bound clients and scripting clients as they use Dual Interfaces.

CSC India 68 Interaction with COM Library

CSC India 69 Object Activation A client application can discover the CLSID of a coclass as well as which IIDs it supports at compile time through inspection of a type library. COM requires that no other dependencies be built between clients and components. As long as a client knows which CSLID and IID to use, it can create and bind to an object.

CSC India 70 Object Activation Once the binding has taken place, the client can invoke methods on the object by accessing the vTable associated with the IID The act of creating and binding to an object is called activation. When a client wants to activate an object, it must make a call to the COM library and pass a CLSID and an IID.

CSC India 71 Service Control Manager The COM service that helps clients with activation is known as the Service Control Manager (SCM). The SCM is entirely dependent on information stored in the Registry Every loadable component associated with an in-process server or an out-of-process server must have a Registry entry that associates it with a physical path to a server's binary image.

CSC India 72 CLSIDs and the Windows Registry The Registry key HKEY_CLASSES_ROOT\CLSID lists the components available to client applications on the machine. Each CLSID key contains one or more subkeys that hold configuration data about the associated component

CSC India 73 CLSIDs and the Windows Registry

CSC India 74 CLSIDs and the Windows Registry Components in an in-process server require an InprocServer32 sub key. Components in an out-of-process server require a LocalServer32 sub key. These keys hold the physical path to the server file; the SCM uses them to find and load the servers during object activation.

CSC India 75 Other Windows Registry The Registry key HKEY_CLASSES_ROOT\TypeLib tracks the physical location of every registered type library on the local machine Each IID plays an important role in binding an object to a client that's running in another process. Every interface that is remotable must have associated configuration data in the Registry key HKEY_CLASSES_ROOT\Interface.

CSC India 76 Registering a server All modern COM servers are self-registering Visual Basic automatically generates self-registration code when a server is build. In-process servers are passive and can't register or unregister themselves without a little help. One can register and unregister them using the Win32 SDK utility REGSVR32.EXE

CSC India 77 Registering a server REGSVR32.EXE ABC.DLL REGSVR32.EXE /u DOGSERVER.DLL REGSVR32.EXE doesn't actually register the server. It simply loads the server and calls a well-known function exposed by the DLL The DLL responds to this call by writing its required configuration information to the Registry.

CSC India 78 Registering a server Out-of-process servers register themselves each time they're launched.

CSC India 79 Service Control Manager & Registry Client passes a CLSID and an IID to the SCM. The SCM starts by looking up the CLSID in the Registry and finding the path to the associated DLL file. The SCM loads the DLL into the client's process. The SCM then calls into the DLL through a well-known entry point and forwards the activation request by passing both the CLSID and the IID.

CSC India 80 Service Control Manager in Action The server responds by creating a new instance of the requested class. It then passes an interface reference (based on the requested interface) back to the SCM. SCM simply forwards this interface reference back to the client. Once the client gets this interface reference, it has been successfully bound to the object.

CSC India 81 Service Control Manager in Action The client can now begin making method calls on the object. Every COM server must therefore provide support for object activation by exposing a well-known entry point through which the SCM can make activation requests.

CSC India 82 Class Factories When the SCM interacts with a server to activate an object, it must acquire a reference to a special type of object called a class factory. class factory object is an agent that creates instances of the class associated with a specific CLSID upon request. A COM server must provide a class factory object for each supported CLSID.

CSC India 83 Class Factories When the SCM receives an activation request, it must acquire a reference to the appropriate class factory object. It does this in different ways, depending on whether the server code is in an in-process DLL or an out-of-process EXE Visual Basic transparently builds in class factory support for each public creatable class

CSC India 84 Class Factories

CSC India 85 ProgIDs A ProgID is simply a text-based alias for a specific CLSID. ProgID consists of two parts. –The first part is the name of the server project that holds the component. –The second part is the friendly class name of the component itself. The self-registration code in a Visual Basic server adds Registry entries to map a ProgID to each supported CLSID to support activation for applications.

CSC India 86 Out of Process COM: Details COM's remoting architecture requires that a proxy/stub layer be introduced between the client and the object. The proxy and the stub establish an Remote Procedure Call (RPC) channel between them to transmit method- related data back and forth.

CSC India 87 Out of Process COM: Details When the client invokes a method on the proxy, the proxy forwards the request to the stub. To properly transmit this request, the proxy marshals the method's inbound parameters and then transmits them to the stub across the RPC channel. When the stub receives the request, it unmarshals the inbound parameters and performs the actual call on the object. the object completes the method and returns control back to the stub, the stub prepares a response by marshaling outbound parameters and a return value.

CSC India 88 Out of Process COM: Details The data is then transmitted back to the proxy Finally, the proxy unmarshals the data in the response and returns control back to the client. Proxies and stubs are created by COM Runtime. When a client calls an object in another process, the proxy and stub are created automatically by the system The client is bound to the proxy instead of the object. And it's the stub, not the client, that gets bound to the object. Neither the client nor the object can tell that calls are being remoted.

CSC India 89 Universal Marshaler The universal marshaler uses interface definitions in type libraries to build proxies and stubs. Interfaces that rely on the universal marshaler are defined in type libraries and in IDL with the [oleautomation] attribut. Every proxy/stub pair is based on a specific IID. When the COM runtime needs to build either a proxy or a stub, it examines the Registry key HKEY_CLASSES_ROOT\Interface to locate configuration information for the interface in question. There is a ProxyStubClsid32 key, which tells the COM runtime where to find the code to build proxies and stubs.

CSC India 90 Universal Marshaler The Registry settings for an interface marked with the [oleautomation] attribute tell the COM runtime to use the universal marshaler. They also tell the universal marshaler which type library holds the interface definition

CSC India 91 Universal Marshaler When the COM runtime determines that it needs to build a proxy or a stub for an oleautomation interface, it forwards the request to the universal marshaler. The universal marshaler then inspects the Registry to find the GUID for the type library associated with the IID. The universal marshaler then locates the type library Once the universal marshaler has the path, it can load the type library, read the interface definition, and build a proxy or a stub.

CSC India 92 Universal Marshaler The universal marshaler uses the TypeLib key to find the physical path to the type library. This path can point to either a stand-alone.TLB file or a COM server with an embedded type library.

CSC India 93 Thanks