Presentation is loading. Please wait.

Presentation is loading. Please wait.

Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.

Similar presentations


Presentation on theme: "Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development."— Presentation transcript:

1 Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development

2 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation2 Session Outline Obsydian OLE Automation Overview Obsydian OLE Automation Overview Microsoft OLE Automation Overview Microsoft OLE Automation Overview Obsydian OLE Automation Framework Obsydian OLE Properties and Methods Examples and Demonstrations Obsydian DCOM Support Summary, FAQ and Questions Summary, FAQ and Questions Obsydian OLE Automation Overview Obsydian OLE Automation Overview Microsoft OLE Automation Overview Microsoft OLE Automation Overview Obsydian OLE Automation Framework Obsydian OLE Properties and Methods Examples and Demonstrations Obsydian DCOM Support Summary, FAQ and Questions Summary, FAQ and Questions

3 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation3 Obsydian OLE Automation Overview Obsydian Functions can be used other application environments such as VB, Office97, C++ Obsydian Functions can be used other application environments such as VB, Office97, C++ Obsydian Functions can be used with MTS Obsydian Functions can be used with MTS Functions can seamlessly inter-operate with multiple development environments Functions can seamlessly inter-operate with multiple development environments Functions can be used simultaneously with OLE and with normal Obsydian applications Functions can be used simultaneously with OLE and with normal Obsydian applications Functions can be remoted using DCOM Functions can be remoted using DCOM Microsoft OLE Automation Supported Microsoft OLE Automation Supported

4 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation4 Microsoft OLE Automation Overview OLE Automation Controller Create an Object Get Existing Object Get / Set Properties Invoke Methods OLE Automation Server Expose Object Properties & Methods Manage Object Creation Manage Object Properties Implement Object Methods OLE Type Library (.TLB) Automation Server Description Object Property and Method Interfaces Help Text for Objects Dispatch Methods

5 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation5 OLE Automation Objects An Instance of a Class ( same as COM) An Instance of a Class ( same as COM) Exposes Properties Exposes Properties Exposes Methods Exposes Methods Exposes Events Exposes Events Automation Controller Use Objects Automation Controller Use Objects Automation Server Implement Objects Automation Server Implement Objects

6 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation6 Excel 97 Object Model

7 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation7 OLE Automation Type Libraries Define Object Properties and Methods Define Object Properties and Methods Source Code with ODL Syntax Source Code with ODL Syntax ODL = Object Description Language ODL = Object Description Language ODL Syntax based on DCE RPC IDL ODL Syntax based on DCE RPC IDL Compiled as.TLB File Compiled as.TLB File Interfaces and Methods Exposed Interfaces and Methods Exposed

8 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation8 OLE Automation Servers Provides Automation Object Services Provides Automation Object Services Manages and Implements Objects Manages and Implements Objects Implements Business or Service Logic Implements Business or Service Logic In Process and Out of Process Servers In Process and Out of Process Servers DCOM and ActiveX Servers DCOM and ActiveX Servers

9 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation9 OLE Automation Controllers Clients of OLE Automation Objects Clients of OLE Automation Objects Manipulates and Drives Objects Manipulates and Drives Objects OLE Automation Client Environments OLE Automation Client Environments OLE Automation Support OLE Automation Support Visual Basic, VBA and VB Script Visual Basic, VBA and VB Script Java and Visual C++ Java and Visual C++ Delphi, Power Builder and Others Delphi, Power Builder and Others Any COM capable environment Any COM capable environment

10 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation10 Obsydian Automation Framework Microsoft OLE Automation Obsydian OLE Automation Framework Obsydian Generated Function C++ OLE Automation Client Java OLE Automation Client VBA OLE Automation Client Visual Basic OLE Automation Client Obsydian Generated Function Obsydian Generated Function COM Component Object Model Architecture Overview IPC

11 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation11 Obsydian OLE Automation Features Obsydian Functions can be called from: Obsydian Functions can be called from: Visual Basic, VBA for Office 97, C/C++, VB ScriptVisual Basic, VBA for Office 97, C/C++, VB Script Java, Power Builder and other ToolsJava, Power Builder and other Tools Provides automatic data type mapping Provides automatic data type mapping Obsydian data types OLE data typesObsydian data types OLE data types No changes required to existing designs No changes required to existing designs Exposes Simple Generic Programmable Objects Exposes Simple Generic Programmable Objects Obsydian Functions can be used by DCOM Obsydian Functions can be used by DCOM

12 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation12 Obsydian OLE Objects App Object App Object Obsydian Application EnvironmentObsydian Application Environment Manages Run Time System ObjectsManages Run Time System Objects Corresponds to one OBRUN.EXE ProcessCorresponds to one OBRUN.EXE Process Function Object Function Object Obsydian generated function proxyObsydian generated function proxy Wrapper to actual generated functionWrapper to actual generated function Call method allows function to be invokedCall method allows function to be invoked

13 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation13 Obsydian Process Model App Object OBRUN Application Process Microsoft OLE Automation Obsydian OLE Automation Framework OLE Automation Client Obsydian Generated Function Microsoft OLE Automation Client ProcessServer Process Function Object Function Object Function Object Obsydian Generated Function Obsydian Generated Function IPC

14 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation14 Obsydian OLE Cardinality Model App Object OLE Automation Client Client ProcessServer Processes Function Object Function Object Function Object App Object Function Object Function Object Function Object App Object Function Object Function Object Function Object IPC

15 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation15 App Properties and Methods Properties: Properties: enviornmentKeyenviornmentKey – –This key is used to control the application environment settings for Obsydian. These environment settings are specified in the OBRUN.INI file for (16 and 32Bit clients) or in the System Registry (for 32Bit NT Servers). These settings include ODBC data source configuration and other variables used by the runtime system. This environmentKey property allows you to control which INI file (or registry entry key for NT) should be used to get the environment settings. Methods: Methods: Function(fileNME As String,implementationNME As String)Function(fileNME As String,implementationNME As String) – –This method creates and returns an Obsydian OLE Function object. This Function object is used to make the actual function call to the generated function. The fileNME string parameter specifies the function’s external DLL file name.

16 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation16 Function Properties and Methods Properties: Properties: fileNMEfileNME – –This name represents the implementation object that is loaded when the Obsydian run time system attempts to call this function. implementationNMEimplementationNME – –This name represents the entry point of the DLL. This is normally the same as the fileNME. Methods: Methods: Call(InParms As Variant, OutParms As Variant)Call(InParms As Variant, OutParms As Variant) – –This method locates, loads and calls an Obsydian generated Function. – –The InParms and OutParms are OLE SafeArray Variant objects that contain the input, dual and output parameters for the function to be called. All of the input and dual parameters for the function should be contained as elements in the InParms array and all of the output parameters should be contained in the OutParms array.

17 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation17 Obsydian OLE Class Table The table above represents the OLE class names and the corresponding OBRUN EXE that is called when an App is created. The class name is used to qualify the App object to create the correct type of Application environment object. For example, if you use the Class Name “ObRunOLE300RSD.App”, to create the App object, OLE Automation will start up a process that begins with OB300RSD.EXE. This will then create the Application environment designed to call Obsydian generated functions built for Obsydian 32Bit NT Debug execution. ObRun and OLE Class Name Table

18 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation18 Visual Basic 5.0 Example Microsoft OLE Automation Obsydian OLE Automation Framework AAVF Category Get Sequential AA10F Category Create Instance IPC

19 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation19 Visual Basic Code Dim FncFileNme As String Dim FncImplNme As String '---------------------------------------------------------------' 'Create the Obsydian application object' '---------------------------------------------------------------' Set ObApp = CreateObject("ObRunOLE300RCD.App") '---------------------------------------------------------------' 'Create the Obsydian functions that we want to call' 'Category.Get Sequential' '---------------------------------------------------------------' FncFileNme = "AAVF" FncImplNme = "AAVF" Set Category_GetSequential = ObApp.Function(FncFileNme, FncImplNme) Create Obsydian App and Function Objects:

20 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation20 Visual Basic Code '---------------------------------------------------------------' 'Define the Input,Dual and Output Parameter Arrays '---------------------------------------------------------------' Dim InParms(5) As Variant '6 Element Variant Array' Dim OutParms(24) As Variant '25 Element Variant Array' '---------------------------------------------------------------' 'Set the input and dual parameters for Category.GetSequential' '---------------------------------------------------------------' InParms(0) = "" 'D: Returning Status' InParms(1) = "" 'I: Positioner.Category Code' InParms(2) = "1" 'I: Input.Instance to get' InParms(3) = 500 'I: Input.Instances to filter' InParms(4) = "" 'I: Selections.Category Code' InParms(5) = "" 'I: Selections.Category Name' Define and Populate Parameters:

21 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation21 Visual Basic Code '---------------------------------------------------------------' 'Set the input and dual parameters for Category.GetSequential' '---------------------------------------------------------------' InParms(0) = "" 'D: Returning Status' InParms(1) = "" 'I: Positioner.Category Code' InParms(2) = "1" 'I: Input.Instance to get' InParms(3) = 500 'I: Input.Instances to filter' InParms(4) = "" 'I: Selections.Category Code' InParms(5) = "" 'I: Selections.Category Name' '---------------------------------------------------------------' 'Call Category.GetSequential' '---------------------------------------------------------------’ Category_GetSequential.Call InParms, OutParms Invoke the Obsydian Function:

22 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation22 Visual Basic Code '---------------------------------------------------------------' 'Read OutParms and Populate the VB Grid Control' '---------------------------------------------------------------' nRows = OutParms(24) ' Instances Fetched’ ' Add the retrieved records to the grid' For Row = 0 To (nRows - 1) 'Build a grid entry for each column' For Col = 0 To (nCols - 1) ColText = OutParms(Row * nCols + Col) Entry = Entry & Chr(9) & ColText Next Grid1.AddItem Entry, Row + 1 Next Use the Dual and Output Parameters:

23 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation23 VBA Office 97 Excel Example AAVF Category Get Sequential Microsoft OLE Automation Obsydian OLE Automation Framework IPC

24 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation24 Visual C++ Example AAVF Category Get Sequential Microsoft OLE Automation Obsydian OLE Automation Framework IPC

25 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation25 “Live” VBA PowerPoint Demo AAVF Category Get Sequential Microsoft OLE Automation Obsydian OLE Automation Framework IPC

26 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation26 Installation and Registration Install Obsydian Runtime System(s) Install Obsydian Runtime System(s) Register the Obsydian Runtime Systems() Register the Obsydian Runtime Systems() OB300RC.EXE /RegisterOB300RC.EXE /Register OB300RS.EXE /RegisterOB300RS.EXE /Register OB300RN.EXE /RegisterOB300RN.EXE /Register Updates Windows OLE Registry Database Updates Windows OLE Registry Database Install Type Libraries with Visual Basic Install Type Libraries with Visual Basic OB300RC.TLB, OB300RN.TLB etc.OB300RC.TLB, OB300RN.TLB etc. Online Obsydian OLE Help File Online Obsydian OLE Help File OLE.HLPOLE.HLP

27 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation27 DCOM Overview Microsoft OLE Automation Obsydian OLE Automation Framework Visual Basic OLE Automation Client Obsydian Generated Function COM DCOM Services COM DCOM Services Microsoft OLE Automation DCE RPC Client Machine Server Machine

28 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation28 DCOM Configuration DCOMCNFG.EXE DCOMCNFG.EXE Specify Application Locations Specify Application Locations Specify Security Attributes Specify Security Attributes Configure DCOM on Remote System(s) Configure DCOM on Remote System(s) Install Application on Remote System(s) Install Application on Remote System(s) Run Client Application as Normal Run Client Application as Normal Client now Creates App Objects Remotely Client now Creates App Objects Remotely

29 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation29 DCOM Configuration Example

30 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation30 Obsydian OLE Automation Summary Functions can participate in MS Component and Object Integration Technologies Functions can participate in MS Component and Object Integration Technologies Functions can seamlessly inter-operate with multiple development environments Functions can seamlessly inter-operate with multiple development environments Functions can be used simultaneously with OLE and with normal Obsydian applications. Functions can be used simultaneously with OLE and with normal Obsydian applications. Functions can be remoted using DCOM Functions can be remoted using DCOM Obsydian applications can be tightly integrated into MS based applications Obsydian applications can be tightly integrated into MS based applications

31 ©1998 Synon, Inc. September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015September 14, 2015 Obsydian OLE Automation31 Obsydian OLE Automation FAQ How do I prepare a function to be used as an OLE Automation Server? How do I set up the parameter interface for the function I want to call? Why do I have to pass parameters in SafeArrays? Why can’t I just pass in each variable or field as structures? How are Obsydian data types mapped between Variants? What is a Type Library and how are they used for OLE Automation? What is a Variant and SafeArrays and how do they work? How do I find out more information about COM and OLE Automation? How do I find out more about using VB and OLE Automation Servers?


Download ppt "Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development."

Similar presentations


Ads by Google