com , ole concept

36
COM , OLE concept By topgun src = Write Ole Control

Upload: lise

Post on 22-Jan-2016

56 views

Category:

Documents


0 download

DESCRIPTION

COM , OLE concept. By topgun src = Write Ole Control. Java. Java app. Java app. Java machine. Java virtual machine. Java machine. Java virtual machine. x86 instruction set. Sparc instruction set. 我猜的. OLE. OLE(activex). COM. binary standard. x86 instruction set. 我猜的. COM object. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COM , OLE  concept

COM , OLE concept

By topgun

src = Write Ole Control

Page 2: COM , OLE  concept

Java

x86 instruction set

Java virtual machine

Java app

Sparc instruction set

Java virtual machine

Java app

Java machine Java machine

Page 3: COM , OLE  concept

OLE

x86 instruction set

COM

OLE(activex)

binary standard

我猜的

Page 4: COM , OLE  concept

COM object

x86 instruction set

binary standard

COM

OLE(control) OLE(automation) script

COM

binary standard

我猜的

Page 5: COM , OLE  concept

Object 長相

Page 6: COM , OLE  concept

我覺得

Java applet

Browser

Activex control

Active x Container

Page 7: COM , OLE  concept

Activex relationship

Activex control

(container)

Activex automation(Server) (Client)

Page 8: COM , OLE  concept

Active X technology

OLE(Active x) Automation (Server) OLE(Active x) Document OLE(Active x) Control …….

Page 9: COM , OLE  concept

Client-Server Model

Server 一定是一個 COM object

Client 不一定要是 Com object

Page 10: COM , OLE  concept

OLE architecture

Page 11: COM , OLE  concept

Local and In-process Server (1)

Local Server

In-process Server

Page 12: COM , OLE  concept

Local and In-process Server (2)

Local ServerLocal Server live in EXE file. Client and local sever live in different process space. The OLE library take care of passing back and forth

between them.

In-process ServerIn-process Server live in DLL file. The host process loads the DLL that contains the COM Server . This means that the in-process server lives

in the same process space as its host .

Local Server

In-process Server

Page 13: COM , OLE  concept

Marshaling

Transport Data across a process boundary( function parameters and return Value )

Local Server

In-process Server

Page 14: COM , OLE  concept

Proxies and stub

Local Server

Page 15: COM , OLE  concept

Standard and Custom Marshaling

OLE Library accomplish standard marshaling use

Built-in proxies and stubs

OLE Library accomplish Custom marshaling use

custom proxies and custom stubs

Page 16: COM , OLE  concept

GUID

CLSID -- a COM server’s GUID is called its class ID(SERVER)

IID -- is a GUID that distinguishes one particular interface from all others(COM)

DISPID -- Dispath ID are numeric identifers that the OLE library use to identify your OLE Control’s property and methods(Control).

Page 17: COM , OLE  concept

Interface (keypad of ATM)

提供輸入的服務 以 regular 和 predictable 方式提供服務 --

例如都是夫入數字與命令 是不變的 -- 如果被廣泛使用就不可以改變 是可以預測的 -- 按下 enter button 是最後

一個指令在波士頓即在三番市,這件事都是對的 .

Page 18: COM , OLE  concept

Interface concept

Page 19: COM , OLE  concept

Interface are Specifications Only

COM Interface define a protocol but ----- in no way implement that protocol

Class Icalculate{public :virtual double sum (double, double)=0;virtual double product (double, double)=0;};

Page 20: COM , OLE  concept

COM SERVER 來實現 “ REUSE“ 的機制

Containment

Delegation ( 委派 )

Aggregation ( 集合體 )

Page 21: COM , OLE  concept

OLE Dcument

ActiveX Document is COM software components that present data and information to the user.

ActiveX Document allow user to view data in a variety of

ways,perhaps as a graph, a spreadsheet, or text

Page 22: COM , OLE  concept

Structured Storage

Page 23: COM , OLE  concept

Store

COMServer

stream

Stream

Save

Page 24: COM , OLE  concept

Compound Document

Support fellow feature

Nested object supportobject conversion

optimized object storageobject linking and embedding

Page 25: COM , OLE  concept

Naming ,Binding and Monikers

Com object store the name and location of other object

Page 26: COM , OLE  concept

Binding

Container

Page 27: COM , OLE  concept

OLE Automation

Automation ServerExpose its method (functionality) and properties ( characteristics )to other objects and application

Page 28: COM , OLE  concept

IDispath

Page 29: COM , OLE  concept

OLE control

OLE control s have three sets of attributes that are expose to the outside world

Property Methods Event

Container

Request

Page 30: COM , OLE  concept

Property(member variable in c)

properties are named attributes or characteristics of an OLE control ------------

Some example of properties are color ,font,number.

Page 31: COM , OLE  concept

Property page

OLE control provide access to their properties though property page(sheet)

(Clock object,might have a property called DisplayType,which indicate digital or analog)

Property can be changed programmatically or though a UI mechanism call property page

是一種由 OLE 控制元件所定義的一種使用者介面,允許使用者直接處理控制元件的 property ,不需要

container 的任何介入

Page 32: COM , OLE  concept

Method (member function in c)

Method are function that client use to direct the actions of OLE servers.

Method are only accessible via OLE automation(IDispath)

OLE Automation properties,method (argument) and (return types)------------------------------------------------------------------

(argument and return )data type1. VARIANT

2.SAFEARRAY3. BSTR

Vt VARENUM VARIANT 中的資造型態iVal short 短整數IVal long 常整數…………… 還很多

Page 33: COM , OLE  concept

Event

OLE object raises an event when something interesting happens

OLE control

Mouse event

container

Page 34: COM , OLE  concept

Control and Automation

OLE Control implement IDispatch to implement OLE Automation

Page 35: COM , OLE  concept

Registry

<vendor>.<Server name>.<version name>“word.Document.6”

Point to the control’s Type LibraryType Library contains the descriptions of object class,interface,dispatch interface

( OLE automation) and type define

Page 36: COM , OLE  concept

Conclusion

automation

Automation &automation

control

Control :ocxautomation :exe and DLL