Bruce Armstrong TeamSybase

Slides:



Advertisements
Similar presentations
By Sam Nasr September 28, 2004 Understanding MSIL.
Advertisements

ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
By Sam Nasr Nasr Information Systems May 14, 2013.
PowerBuilder.NET Guided Tour. PowerBuilder A New PowerBuilder IDE for.NET Development.
Best Practices for Interop with Visual C++ Boris Jabes Program Manager Microsoft Corporation.
Microsoft.NET Framework Interop Brian Long Master Consultant Falafel Software.
C# Programming: From Problem Analysis to Program Design1 Creating Your Own Classes C# Programming: From Problem Analysis to Program Design 3rd Edition.
Advanced Object-Oriented Programming Features
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
2. Developing in.NET and C#. 2 Microsoft Objectives “Microsoft.NET development is based on an underlying framework of tools and classes. These tools and.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
.NET SIG Presentation on Visual Studio Tools for Office – A Primer by Anthony Maimone & Ted Ogrean.
DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information.
Introduction to .Net Framework
Sponsored by Powered by Moving at the Speed of Change May 2015 Charlotte PowerBuilder Conference Using.Net Nonvisual Assemblies In Powerbuilder Classic.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Understanding Code Compilation and Deployment Lesson 4.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
Nilotpal Bhattacharya Partner Technical Consultant| Microsoft.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Managed C++. Objectives Overview to Visual C++.NET Concepts and architecture Developing with Managed Extensions for C++ Use cases Managed C++, Visual.
.NET Framework Danish Sami UG Lead.NetFoundry
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Upgrading Applications to VB.NET Leveraging Your Visual Basic 6 Investments with VB 2005 & the Interop Forms Toolkit 2.0 Jonathan Aneja Program Manager.
Component Services Tom Perkins - CertSIG. Software Component (Definition) A software component is a system element that –Offers a predefined service –Is.
C# D1 CSC 298 Elements of C# code (part 2). C# D2 Writing a class (or a struct)  Similarly to Java or C++  Fields: to hold the class data  Methods:
1 Classes and Controls CE-105 Spring 2007 By: Engr. Faisal ur Rehman.
Module 3: Working with Components. Overview An Introduction to Key.NET Framework Development Technologies Creating a Simple.NET Framework Component Creating.
Generic API Test tool By Moshe Sapir Almog Masika.
Introduction to Exception Handling and Defensive Programming.
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
PI Data Archive Server COM Points Richard Beeson.
ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.
DAT372 Programming Microsoft® SQL Server DTS 2000 using.NET (Visual Basic®.NET and C#) Gert E.R. Drapers Architect Microsoft Corp.
Programming with Visual Studio 2005.NET A short review of the process.
Programming with Visual Studio.NET A short review of the process.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
Attributes C#.Net Software Development Version 1.0.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
Wel come To Seminar On C#.
.NET Mobile Application Development XML Web Services.
Getting Started with Oracle Berkeley DB 11gR2 and ADO.NET
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
C# 5.0 Alex Davies 22 nd December What we will cover C# 5.0,.NET 4.5, Visual Studio 11 Caller Info Attributes Upgrade from synchronous to asynchronous.
How to Leverage Java in Oracle Forms Web Applications Duncan Mills Application Development Tools Oracle Corporation.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
Automation Engr. Faisal ur Rehman CE-105T Spring 2007.
CE-105 Spring 2007 By: Engr. Faisal ur Rehman
Jim Fawcett CSE687 – Object Oriented Design Spring 2001
Component Object Model
Component Object Model
Creating Your Own Classes
INF230 Basics in C# Programming
CIS 200 Test 01 Review.
Native / Managed Interop
CS360 Windows Programming
Module 0: Introduction Chapter 2: Getting Started
Creating and Using Classes
Conditional Statements
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
C# COM Interoperability
DAT 320 SQL Server 2000: DTS and .NET
Presentation transcript:

Bruce Armstrong TeamSybase

Techniques  PowerBuilder 11 and beyond only Referencing.Net assemblies directly within Conditional Code blocks in PowerScript  Any version of PowerBuilder.Net Interop via COM Callable Wrappers

Referencing.Net Assemblies  Currently only non-visual assemblies Visual assemblies is a release milestone for PowerBuilder 12  Conditional Code blocks AutoScript is not supported (errors are reported at compile time) Syntax is neither PowerScript or C# but a mix of them (PowerScript#)

.Net Interop  Runtime Callable Wrapper  COM Callable Wrapper

Allows a.Net application to use a Win32 COM object Runtime Callable Wrapper COM Object Runtime Callable Wrapper.Net Application

Allows a Win32 application to use a.Net object via COM COM Callable Wrapper.Net Object COM Callable Wrapper Win32 Application

COM Callable Wrapper  Assembly has to be COM-Visible Assembly can be marked such at compile time FxCop can be used to determine if marked ILSASM/ILASM can be used (in some cases) to change the marking

COM Callable Wrapper  Marking the Assembly COM-Visible in Visual Studio

Using FxCop  Examining the COM-Visible attribute using Microsoft’s FxCop

ILDASM  ILASM (IL Assembler) is part of the.Net runtime Typical location: C:\WINDOWS\Microsoft.NET\Framework\v In the System Path  ILDASM (IL Disassembler) is part of the.Net SDK Typical Location: C:\Program Files\Microsoft.NET\SDK\v2.0\Bin May not be in the System Path

Using ILDASM  Examining the COM-Visible attribute in the disassembled IL

REGASM .Net Assembly Registration Utility  Used to create COM registry entries for.Net component  Syntax: RegAsm AssemblyName [Options] Options: /unregister /regfile[:FileName] /codebase

REGASM Output  With regfile option but without codebase option

REGASM Output  With regfile option and codebase option

Registry Free COM  Not.Net specific, can be used for any COM components  Supported on Windows version XP and later (e.g., 2003, Vista, 2008)  us/library/ms aspx us/library/ms aspx

How Registry Free COM Works Client App Client App.Manifest Dependant Assembly (COM Component) Dependant Assembly.Manifest

GenMan32  Useful utility for generating manifest files for Registry Free COM  Syntax: GenMan32 AssemblyName [Options] Options: /add /out:filename  generate-sxs-manifest-for-managed-assembly-for-registration-free-com-net- interop.aspx generate-sxs-manifest-for-managed-assembly-for-registration-free-com-net- interop.aspx

GenMan32 Output

CCW Limitations  Types, methods, properties, fields and events must all be public  Methods must not be static  Types must have a public default constructor  Overloaded methods should be avoided  Late binding clients can’t retrieve error information from.Net exceptions  PowerBuilder Specific: Events

Avoid Overloaded Methods.Net Class foo ( int a ) foo ( string a ) foo ( long a ) COM Wrapper foo (int a ) foo_2 ( string a ) foo_3 ( long a )

Why error information gets lost PowerBuilder Client CCW.Net Assembly IDispatch Exception 3. Exception Thrown 4.SetErrorInfo 5. GetErrorInfo 1. COM Call 2..Net Call 6. Return from call

What we can do about it Managed Exception Logger Exception Publisher Event Log Debug Window Managed Exception Queue CCW IDispatch Exception

Further Reading  Microsoft’s Exception Handling Application Block us/library/cc aspx  Get Seamless.NET Exception Logging From COM Clients Without Modifying Your Code us/magazine/cc aspx

Interop Forms Toolkit 2.0  Not just forms, but controls as well us/vbasic/bb aspx us/vbasic/bb aspx  Can be used in the Express versions of Visual Studio with some limitations  C# implementation available on CodeProject -_C__Interop_Form.aspx -_C__Interop_Form.aspx

Supporting Events  Create a Interface of type ComInterfaceType.InterfaceIsIDispatch with the defined events Provide a GUID for the interface Assign a unique DispID for each event  Add a ComSourceInterfaces attribute to the control  Define the events within the control  Call those events from within the user control

Event Declaration Interface

Implementing Events

Events exposed in PowerBuilder

Questions