COM Objects
description
Transcript of COM Objects
![Page 1: COM Objects](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/1.jpg)
ITE 370
![Page 2: COM Objects](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/2.jpg)
Com TechnologyComponent Object ModelAllows communication between shared
componentsAllows Re-useable software components
Code LibrariesDLL’s Active X controls
![Page 3: COM Objects](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/3.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/4.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/5.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/6.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/7.jpg)
Web Browser Example
![Page 8: COM Objects](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/8.jpg)
CodeButton Click Event
Dim strURL As StringstrURL = txtWebAddress.TextWebBrowser1.Navigate(strURL)
![Page 9: COM Objects](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/9.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/10.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/11.jpg)
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](https://reader035.fdocuments.us/reader035/viewer/2022062422/56813ff5550346895dab1959/html5/thumbnails/12.jpg)
COM ComponentsUses For ???
Found ???