COM Component Object Model - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

COM Component Object Model

Description:

O/S calling function implementation and DEF file editing. DllUnRegisterServer ... OLE (Object Linking and Embedding) Example: Excel data in MS Word ... – PowerPoint PPT presentation

Number of Views:383
Avg rating:3.0/5.0
Slides: 9
Provided by: hkk4
Category:
Tags: com | component | model | object | ole

less

Transcript and Presenter's Notes

Title: COM Component Object Model


1
COM (Component Object Model)
2
COM
  • COM Server
  • DLL (in-process) or EXE (out-of-process
    marshalling)
  • Register CLSID (GUID) in windows register
  • Interface class
  • Consists of pure virtual functions
  • Implementation of Interface class
  • Inherit from the Interface
  • Implement the pure virtual functions
  • COM Client
  • Find the DLL in windows register
  • Find a interface
  • Call functions of the interface
  • COM Library
  • O/S services supporting COM

3
COM Support in Visual C
  • MFC Library
  • ATL (ActiveX Template Library)
  • Provided with Source Code
  • Use template Class
  • Small Size

4
COM Interface
  • IUnknown
  • Root interface
  • Methods
  • Addref ()
  • Increase count
  • Release ()
  • QueryInterface (IID)

5
COM Server Implementation
  • Project MFC DLL
  • CLSID and IID generation
  • Viusalstudio\common\tools\guidgen.exe
  • Registration of CLSID
  • HKEY_CLASSES_ROOT\CLSID directory
  • RegSvr32.exe
  • Call DllRegisterServer() function of DLL
  • Interface implementation
  • ?) Add(), Sub()
  • CoClass imlementaion
  • Addref()
  • Release()
  • QueryInterface()
  • Add(), Sub()
  • Class Factory Implementation
  • O/S calling function implementation and DEF file
    editing
  • DllUnRegisterServer()
  • DllRegisterServer()
  • DLLGetClassObject()

6
CoClass (Component Object Class)
  • Consists
  • interfaces
  • its implementation
  • CLSID
  • COM Object
  • Class Factory
  • CoClass
  • Generats CoClasses in a DLL
  • Interface IClassFactory
  • Methods CreateInstance, LockServer

7
COM Applications
  • Automation
  • Script language Com client
  • IDispatch interface
  • OLE (Object Linking and Embedding)
  • Example Excel data in MS Word
  • Interface IOleContainer, IOleObject, etc
  • Clipboard
  • Interface IDataObject
  • DragDrop
  • Interface IDropTarget, IDropSource
  • ActiveX Control (.ocx)

8
COM Client
  • GoGetClassObject()
  • Generate COM object
  • QueryInterface()
  • Get the pointer of interface
  • Call the methods of the interface
  • Release()
  • Free COM object from memory
Write a Comment
User Comments (0)
About PowerShow.com