Ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software.

Slides:



Advertisements
Similar presentations
Component Object Model
Advertisements

COM and.Net Components By Sam Nasr January 25,
.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
Fundamentals of COM Mary Kirtland Program Manager COM Team Microsoft Corporation.
COM vs. CORBA.
Intro to COM What is it and how do I use it?. Objectives Teach the fundamentals of COM. Understand the reason for using it. Learn to make a simple in-process.
Components David Talby. This Lecture What Components Are With Demonstrations in Delphi Common Object Model (COM) Creating and calling objects Distributed.
ACTIVE X By Ethan Huang. OUTLINE What is ActiveX? Component of ActiveX Why ActiveX? ActiveX and Java Security Issue.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
1 COM/DCOM n Part of Project Presentation (Concept Outline)
Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.
COM: Microsoft's Component Object Model Andrew C. Hopkins CSCI 397C-16 Object Oriented Database Design and Management Professor Renee Renner.
AP 01/01 Interface Definition Language Types are problematic: –Weakly typed C language: short / int / long –Architecture-specific data types IDL is a strongly.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Intro to COM What is it and what can it do for me?
DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among.
DCOM Technology Şevket Duran Haşim Sak.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
1 Modular Software/ Component Software 2 Modular Software Code developed in modules. Modules can then be linked together to produce finished product/program.
Visual Basic: An Object Oriented Approach 12 – Creating and using ActiveX objects.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
CHAPTER 3 The Component Object Model and DirectX © 2008 Cengage Learning EMEA.
CSC Proprietary 9/11/2015 2:16:16 AM 008_P2_CSC_white 1.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
CIS 338: Creating ActiveX Controls Dr. Ralph D. Westfall March, 2003.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
Threading Models in Visual Basic Language Student Name: Danyu Xu Student ID:98044.
Chapter 1: Creating ActiveX Clients By Noppadon Kamolvilassatian Dept. of Computer Engineering, Prince of Songkla University Source: Mastering Visual Basic.
Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
OLE / COM Helia / Martti Laiho Sources: MSDN Kraig Brockschmidt: Inside OLE Orfali-Harkey-Erwards: Client/Server Survival Guide.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
Introduction to COM and DCOM Organizational Communications and Technologies Prithvi N. Rao H. John Heinz III School of Public Policy and Management Carnegie.
COMCOM omponent bject odel After this presentation, you will: Be Able To: Conceptual understanding of COM How it works, What it’s used for Decode Acronyms.
Component Object Model
Information Management NTU Interprocess Communication and Middleware.
A COM implementation of the KSpace A ‘Knowledge Space prototype’ by Santhosh CST
ICONICS ActiveX ToolWorX V 6.1.
VBScript Microsoft Visual Basic: Scaleable Solutions Visual Basic  Best tool for distributed client/server solutions  Powerful, robust,
Making LabVIEW look like an IOC Kay-Uwe Kasemir, LANL May 2002.
Introduction to COM and ActiveX Controls. What is an object? In the Fayad sense of the word.
CS551 - Lecture 15 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
GAM666 – Introduction To Game Programming ● DirectX is implemented as a collection of COM objects ● To use a DirectX program, the user must have the correct.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
COM / DCOM Xiaolan Lu Mingzhen Wang Dong Xie. Why COM / DCOM?  Challenges facing the software industry  Component software provides a solution  General.
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
OLE Automation 主講人:虞台文. Content BSTR  String data type in OLE VARIANT & VARIANTARG IDispatch Create COM Objects Using ATL.
CS551 - Lecture 12 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Type Information 主講人:虞台文. Content Overview The Type Library Building Type Library Type Library Deployment Loading and Using a Type Library Objects with.
.NET Mobile Application Development XML Web Services.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
OPC Status Nov CA Client->OPC: Andrei Makhnachev,DESY OPC-> CA Server: Kay-Uwe Kasemir, LANL OPC Experience: Matthias Clausen, DESY.
Components David Talby. 9/27/2016 Object Oriented Design Course 2 This Lecture What Components Are With Demonstrations in Visual Basic Common Object Model.
Automation Engr. Faisal ur Rehman CE-105T Spring 2007.
Component Object Model(COM)
Component Object Model
Component Object Model
University of Central Florida COP 3330 Object Oriented Programming
Microsoft’s Distributed Component Object Model (DCOM)
Interface Definition Language
.Net A brief introduction to
C# COM Interoperability Late Binding
University of Central Florida COP 3330 Object Oriented Programming
COM, DCOM and Software Components
Active Template Library
Presented By Justas Raslanas
Automation and IDispatch
CORBA and COM TIP Two practical techniques for object composition
Presentation transcript:

ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A)

ni.com Outline  What is ActiveX?  Why use COM/ActiveX  What is COM?  What are ActiveX/COM Servers Objects Interfaces More  What is ActiveX?  Why use COM/ActiveX  What is COM?  What are ActiveX/COM Servers Objects Interfaces More

ni.com What is ActiveX all about?  Demonstrations Document objects Automation Controls Containers  Demonstrations Document objects Automation Controls Containers

ni.com What is ActiveX?  The name for technologies built on top of COM  Examples include: Document objects ActiveX controls Automation OLE for process control (OPC)  Grew out of OLE  The name for technologies built on top of COM  Examples include: Document objects ActiveX controls Automation OLE for process control (OPC)  Grew out of OLE

ni.com Motivation for COM/ActiveX  Component software development Reuse of binary software components Create and use components from various languages Update components without recompiling or breaking existing clients  Object-based model  Distributed software  Location transparency  Component software development Reuse of binary software components Create and use components from various languages Update components without recompiling or breaking existing clients  Object-based model  Distributed software  Location transparency

ni.com What About DLLs?  Calling conventions can vary  DLLs are not object based (Flat API)  Versioning can be difficult  Memory management concerns  Linkage issues  Calling conventions can vary  DLLs are not object based (Flat API)  Versioning can be difficult  Memory management concerns  Linkage issues

ni.com What is COM?  Component object model  Binary and network standard  Run-time system Calls across network Location transparency Security  Component object model  Binary and network standard  Run-time system Calls across network Location transparency Security

ni.com COM Servers  Can be DLLs or EXEs  Provide objects for clients A single server can provide implementations for more than one object The set of objects that a server provides and the relationships between them is referred to as an object hierarchy  Are activated by the COM run-time services  Can be DLLs or EXEs  Provide objects for clients A single server can provide implementations for more than one object The set of objects that a server provides and the relationships between them is referred to as an object hierarchy  Are activated by the COM run-time services

ni.com Object Hierarchy Top Level Objects (Creatable) Lower Level Objects (Non-Creatable)

ni.com COM Objects  Clients view objects as black boxes  Clients communicate with objects only through interfaces  Objects can handle more than one interface  Clients view objects as black boxes  Clients communicate with objects only through interfaces  Objects can handle more than one interface Object Interface2 Interface1 Interface3

ni.com COM Interfaces  Sets of related methods  Immutable contracts  Implementations not described NO member data (functions only)  COM defines a standard for in-memory layout of interfaces  Sets of related methods  Immutable contracts  Implementations not described NO member data (functions only)  COM defines a standard for in-memory layout of interfaces

ni.com Interface Benefits  Compiler neutral  Language neutral  Object implementations can change without affecting clients Clients never need to be recompiled  Versioning  Compiler neutral  Language neutral  Object implementations can change without affecting clients Clients never need to be recompiled  Versioning

ni.com Sample Interfaces  IAnimal Eat Sleep Walk  IDog : IAnimal Bark Fetch ChaseCat  IAnimal Eat Sleep Walk  IDog : IAnimal Bark Fetch ChaseCat  IGuard SoundAlarm AttackBadGuy

ni.com Sample Object Guard Dog Object IAnimal IDog IGuard

ni.com IUnknown Interface  Every COM interface inherits from IUnknown  IUnknown includes functionality needed by every object Provides a mechanism for clients to obtain one interface from another interface Provides object lifetime manangement  Every COM interface inherits from IUnknown  IUnknown includes functionality needed by every object Provides a mechanism for clients to obtain one interface from another interface Provides object lifetime manangement

ni.com IUnknown Interface  Mechanism to get from one interface on an object to another interface on the object HRESULT QueryInterface (REFIID riid, void **ppvObject);  Mechanism to manage object lifetimes Clients do not delete COM objects directly COM objects are responsible for deleting themselves COM objects are reference counted ULONG AddRef ( ); ULONG Release ( );  Mechanism to get from one interface on an object to another interface on the object HRESULT QueryInterface (REFIID riid, void **ppvObject);  Mechanism to manage object lifetimes Clients do not delete COM objects directly COM objects are responsible for deleting themselves COM objects are reference counted ULONG AddRef ( ); ULONG Release ( );

ni.com Registration of Servers  Servers are registered with the system HKEY_CLASSES_ROOT CLSID {E312522E-A7B7-11D1-A52E-0000F8751BA7} Default = “Guard Dog Object” InprocServer32 = "D:\Examples\AnimalLib\AnimalLib.dll" AnimalLib.GuardDog CLSID Default = “{E312522E-A7B7-11D1-A52E- 0000F8751BA7}”  Servers are registered with the system HKEY_CLASSES_ROOT CLSID {E312522E-A7B7-11D1-A52E-0000F8751BA7} Default = “Guard Dog Object” InprocServer32 = "D:\Examples\AnimalLib\AnimalLib.dll" AnimalLib.GuardDog CLSID Default = “{E312522E-A7B7-11D1-A52E- 0000F8751BA7}”

ni.com Event Interfaces  Interface provides communication from the server back to the client  Server defines an interface that it calls to notify the client that an event occurred  Client supplies server with a pointer to the interface  Client’s code is executed when the server calls methods in the event interface  Interface provides communication from the server back to the client  Server defines an interface that it calls to notify the client that an event occurred  Client supplies server with a pointer to the interface  Client’s code is executed when the server calls methods in the event interface

ni.com Example Event Interface  IDogEvents AmHungry WantAttention NeedToGoOutside  IDogEvents AmHungry WantAttention NeedToGoOutside

ni.com IDispatch Interface  Automation servers must handle IDispatch  ActiveX controls must handle IDispatch  IDispatch gives scripting clients access to COM objects Microsoft Office Internet Explorer Old versions of Visual Basic  Automation servers must handle IDispatch  ActiveX controls must handle IDispatch  IDispatch gives scripting clients access to COM objects Microsoft Office Internet Explorer Old versions of Visual Basic

ni.com IDispatch Interface  IDispatch::Invoke provides access to an entire interface through a single function  Clients use the Invoke function to call all methods Specify method by method ID Pass parameters in a single large structure  Invoke understands only Automation types Yes: int, double, enum, boolean, structures Yes: BSTR, SafeArray, Variant No: unions, C style arrays, C style strings  IDispatch::Invoke provides access to an entire interface through a single function  Clients use the Invoke function to call all methods Specify method by method ID Pass parameters in a single large structure  Invoke understands only Automation types Yes: int, double, enum, boolean, structures Yes: BSTR, SafeArray, Variant No: unions, C style arrays, C style strings

ni.com COM/ActiveX Programming  Many environments provide some tools to make writing COM servers and clients easier Wrappers for accessing COM servers Wizards to create skeleton servers or controls Tools to add interfaces, methods, properties Free implementations of some standard interfaces  Measurement Studio Visual Basic, Visual C++, LabWindows/CVI  LabVIEW™  Many environments provide some tools to make writing COM servers and clients easier Wrappers for accessing COM servers Wizards to create skeleton servers or controls Tools to add interfaces, methods, properties Free implementations of some standard interfaces  Measurement Studio Visual Basic, Visual C++, LabWindows/CVI  LabVIEW™

ni.com ActiveX and NI Products  ActiveX controls Measurement Studio  Containers LabVIEW, BridgeVIEW™  Automation servers LabVIEW, Measurement Studio, HiQ™, DataSocket™  Clients LabVIEW, BridgeVIEW, Measurement Studio, TestStand™  ActiveX controls Measurement Studio  Containers LabVIEW, BridgeVIEW™  Automation servers LabVIEW, Measurement Studio, HiQ™, DataSocket™  Clients LabVIEW, BridgeVIEW, Measurement Studio, TestStand™

ni.com COM/ActiveX Resources  Essential COM Don Box (Addison-Wesley, 1998)  Inside COM Dale Rogerson (Microsoft Press, 1997)  Various MSDN Articles  NI Product Examples  Essential COM Don Box (Addison-Wesley, 1998)  Inside COM Dale Rogerson (Microsoft Press, 1997)  Various MSDN Articles  NI Product Examples