DCOM(Distributed COM). Presenter: 資管研一 R89725009 呂江麟 資管研一 R89725037 劉英和. 大綱. Component Object Model Distributed COM DCOM Example With MFC SAP: DCOM Component Connector. Component Object Model. COM – 軟體之間提供服務的一種標準方式 COM 是一組規格: 描述 COM 元件建立時所必須遵守的準則
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
COM Runtime 元件和應用程式 COM Runtime 核心服務(Monikers, Storage, Data Transfer,...) [D]COM Registry Pluggable Security(SSPI) MS-RPC Pluggable Transports NTLM DCE Kerberos ETC... TCP UDP IPX Tunneled TCP ETC...
Security Lifecycle Management Type Information (Interface Repository) Monikers (Naming) Automation (Dynamic Invocation) Data Transfer Component Categories Registry Core COM Services
Proxy Component COM Runtime ArchitectureFlexible and extensible Pluggable Transports Client Machine Server Machine TCP, UDP COMClient SPX,IPX COM Runtime COM Runtime Net BUI HTTP “Falcon” Other Component
Proxy Component COM Runtime ArchitectureFlexible and extensible Pluggable Security Providers Client Machine Server Machine NTLM COMClient SSL, Certs. COM Runtime COM Runtime NT Kerberos DCE Other Component
COM 程式設計模型 用戶端行程 用戶端程式 OLE32.DLL Service Control manager (RPCSS.EXE)
元件行程 Object OLE32.DLL COM 程式設計模型 用戶端行程 用戶端程式 OLE32.DLL Service Control manager (RPCSS.EXE)
Object stub proxy COM 程式設計模型 元件行程 用戶端行程 用戶端程式 OLE32.DLL OLE32.DLL Service Control manager (RPCSS.EXE)
Object stub proxy COM 程式設計模型 元件行程 用戶端行程 用戶端程式 OLE32.DLL OLE32.DLL Service Control manager (RPCSS.EXE)
Object stub proxy COM 程式設計模型 元件行程 用戶端行程 用戶端程式 COM 的攔截機制 OLE32.DLL OLE32.DLL Service Control manager (RPCSS.EXE)
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 • Same tools, knowledge, code
Distributed COM • Wire Protocol • Based on DCE RPC Specification • Interoperable with OSF DCE RPC implementations • We call it “ORPC” • 指定元件的伺服器的位置 • CreateObject(ProgID, “Jacky”) • DCOMCNFG.EXE
To implement a class using MFC’s interface maps follows these steps: Implementation With MFC(1) 1.Use Derive a class either directly or indirectly from CCmdTarget. 2.Use the DECLARE_INTERFACE_MAP function in the derived class definition. 3.For each interface you wish to support, use the BEGIN_INTERFACE_PART、 END_INTERFACE_PART macros in the class definition.
Implementation With MFC(2) 4.In the implementation file, use the BEGIN_INTERFACE_MAP and END_INTERFACE_MAP macros to define the class's interface map. 5.For each IID supported, use the INTERFACE_PART macro between the BEGIN_INTERFACE_MAP and END_INTERFACE_MAP macros to map that IID to a specific "part" of your class.
Implementation With MFC(3) 6.Implement each of the nested classes that represent the interfaces you support. 7.Use the METHOD_PROLOGUE macro to access the parent, CcmdTarget-derived object. 8.AddRef, Release, and QueryInterface can delegate to the CcmdTarget implementation of these functions: ExternalAddRef, ExternalRelease, and ExternalQueryInterface.
Macro of MFC Implementation(1) BEGIN_INTERFACE_PART(localClass, iface); END_INTERFACE_PART(localClass) localClass:實作 interface 的 class iface:class 實作的 interface 用來產生巢狀類別,它會把X加到第一個參數名稱前,以組成類別名稱。
Macro of MFC Implementation(2) DECLARE_INTERFACE_MAP 產生一個表格的宣告,這個表格內含所有類別的介面識別碼 BEGIN_INTERFACE_MAP(theClass, baseClass) END_INTERFACE_MAP theClass :要建立 interface 的 class baseClass:該 class所繼承的類別 在implement時,實際定義 interface map。
Macro of MFC Implementation(3) STDMETHOD_ 在宣告敘述(*.h file)中,宣告method。 STDMETHODIMP_ 在implement中(*.cpp),定義method。 此兩巨集將傳回值指定為第一個參數。