120 likes | 259 Views
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
E N D
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 • Take advantage of Windows Services • Used in MicroSoft Office Applications • Allows Word to link to Excel Spreadsheet • Building Scripts for Repetitive tasks • Control one application from another
COM & .Net Components • Complementary Technologies • .Net Components can call COM Components • COM Components can call .NET Components • .Net Components • Better Security • Better Memory Management • Web Services Support • Thousands of useful COM components
COM Components in Visual Studio • Add a Web Browser to a Visual Studio Application • VBWebBrowsingService is a COM Component • Project Menu Add Reference • Select COM Tab • Scroll Down to VBWebBrowsingService • OK
COM Components is Visual Studio • COM Component now added to Toolbox • Add Web Browser to Form • Add a Textbox (for a URL Address) • Named “txtWebAddress” • Add a Button to Execute • Named “btnConnect” • Text “Browse Web”
Code • Button Click Event Dim strURL As String strURL = txtWebAddress.Text WebBrowser1.Navigate(strURL)
Managed Code • Code that operated within the .Net Common Language Runtime (CLR) • Has access to all services of CLR • Cross Language Integration • Security • Garbage Collection
Unmanaged Code • Legacy COM Components are Unmanaged • Operates outside of CLR • Does not have natural access to services of CLR • Uses Proxy Software for access to CLR • Accepts commands from one component • Modifies them • Forwards them to another component • Create Runtime-Callable Wrapper (RCW)
External COM Components – in .Net • Add a Reference to a COM Component • Project Add Reference • Browse Tab • OK • Creates the RCWs • Creates a DLL in the /BIN folder • Cannot share among multiple applications
COM Components • Uses For ??? • Found ???