COM Objects

12
ITE 370

description

COM Objects. ITE 370. Com Technology. Component Object Model Allows communication between shared components Allows Re-useable software components Code Libraries DLL’s Active X controls. COM Technology. Create re-usable software components Link Components together to build applications - PowerPoint PPT Presentation

Transcript of COM Objects

Page 1: COM Objects

ITE 370

Page 2: COM Objects

Com TechnologyComponent Object ModelAllows communication between shared

componentsAllows Re-useable software components

Code LibrariesDLL’s Active X controls

Page 3: COM Objects

COM TechnologyCreate re-usable software componentsLink Components together to build

applicationsTake advantage of Windows ServicesUsed in MicroSoft Office Applications

Allows Word to link to Excel SpreadsheetBuilding Scripts for Repetitive tasksControl one application from another

Page 4: COM Objects

COM & .Net ComponentsComplementary Technologies.Net Components can call COM ComponentsCOM Components can call .NET Components.Net Components

Better SecurityBetter Memory ManagementWeb Services Support

Thousands of useful COM components

Page 5: COM Objects

COM Components in Visual StudioAdd a Web Browser to a

Visual Studio ApplicationVBWebBrowsingService is a

COM ComponentProject Menu Add

ReferenceSelect COM TabScroll Down to

VBWebBrowsingServiceOK

Page 6: COM Objects

COM Components is Visual StudioCOM Component now added to

ToolboxAdd Web Browser to FormAdd a Textbox (for a URL Address)

Named “txtWebAddress”Add a Button to Execute

Named “btnConnect”Text “Browse Web”

Page 7: COM Objects

Web Browser Example

Page 8: COM Objects

CodeButton Click Event

Dim strURL As StringstrURL = txtWebAddress.TextWebBrowser1.Navigate(strURL)

Page 9: COM Objects

Managed CodeCode that operated within the .Net Common

Language Runtime (CLR)Has access to all services of CLR

Cross Language Integration Security Garbage Collection

Page 10: COM Objects

Unmanaged CodeLegacy COM Components are UnmanagedOperates outside of CLRDoes not have natural access to services of

CLRUses Proxy Software for access to CLR

Accepts commands from one component Modifies them Forwards them to another component

Create Runtime-Callable Wrapper (RCW)

Page 11: COM Objects

External COM Components – in .NetAdd a Reference to a COM ComponentProject Add ReferenceBrowse TabOKCreates the RCWsCreates a DLL in the

/BIN folderCannot share among

multiple applications

Page 12: COM Objects

COM ComponentsUses For ???

Found ???