YOUR FEEDBACK
Immo Huneke wrote: A well written article, an ingenious solution to a real problem often encountere...

SYS-CON.TV
TOP MICROSOFT .NET LINKS


PowerBuilder 11's .NET Interoperability
Creating and consuming .NET resources

PowerBuilder 11 deploys entire applications as .NET Windows Form or Web Form applications and deploys individual components as .NET Assemblies and as .NET Web Services. Version 11 consumes resources of the default .NET framework as well as resources of custom developer-defined .NET resources. Non-PowerBuilder .NET solutions can interoperate with, and take advantage of, the unparalleled productivity of PowerBuilder’s data access and data manipulation capabilities. In short, PowerBuilder 11 creates as well as consumes .NET resources.

Once PowerBuilder 11 has deployed an application or a component as .NET, the developer can begin taking advantage of external .NET resources on a scripted basis through PowerScript enhancements. The scripted .NET interoperability in PowerBuilder 11 is predicated on a new conditional compilation feature. Conditional compilation allows declarations, references and calls, etc. that are meant for .NET interop to be declared within preprocessor blocks of code. These preprocessor blocks are constructs similar to IF statements. If the developer specifies that these #IF/THEN/#ELSE/#ELSEIF blocks are only for .NET runtime execution, they’re ignored by PowerBuilder’s Win32 compiler.

Conditional Compilation
The developer doesn’t need to commit the syntax of the new constructs to memory or lose his or her train of thought switching from the IDE to a help file. A productive addition to the PowerScript editor enables the developer to quickly paste in the desired flavor of .NET #IF statement (see Figure 1).

The preprocessor variants allow the developer to provide for a blanket .NET deployment condition and, if they wish, to drill down to specific flavors of that deployment like WinForms, WebForm, Web Services, etc. (see Table 1).

Establishing a Reference to the .NET Assembly
Once the developer has identified a .NET resource of which they wish to take advantage, the .NET Assembly in question needs to be brought into the scope of the PowerBuilder .NET target so that script references to it may be made. Whether your PowerBuilder .NET target is for WinForm, WebForm, a .NET Assembly, or a .NET Web Service, right-mouse button-click on that target in the PowerBuilder System Tree and choose “Properties...” from the popup menu (see Figure 2). In the Target Properties window, select the “.NET Assemblies” tab page and click on the button that will allow you to browse for your Assembly. Select your Assembly, then click OK to close the Target Properties window.

For the purposes of this tutorial, I’ve chosen an Assembly that is part of the default .NET framework, MSCORLIB.DLL (see Figure 3). If you wish, expand the Assembly’s node in the System Tree to browse what’s available in the Assembly’s public interface.

About John Strano
John Strano is a Sybase Technology Evangelist and is a charter member of TeamSybase. He has been using PowerBuilder since 1991 and has authored articles for multiple industry periodicals. John has been a Sybase Certified Instructor and has presented Sybase tools on an international basis since 1997. Over the last 17 years John has developed a variety of PowerBuilder applications from single-user scaling up to enterprise-class, web-based projects.

YOUR FEEDBACK
Jerry wrote: Anybody have an example that copies a .NET arraylist to a Powerbuilder datawindow or Listview?
MICROSOFT .NET LATEST STORIES
Midnight Coders has launched WebORB PDF Generator, a solution consisting of a SDK and runtime PDF generation engine that enables Flex, Flash, AJAX and Silverlight clients to create PDF documents from application data. The product is designed for organizations that need to support compl...
At the opening keynote of the Consumer Electronics Show (CES) Wednesday night, Microsoft CEO Steve Ballmer, making his first appearance at the show in a slot that used to be reserved for Bill Gates, announced the widely anticipated, feature-complete beta of the company’s new Windows ...
MYNAH Technologies has announced the release of its MiMiC v3.1.0 Simulation Software for operator training and automation system testing. This release includes enhancements to simulation dynamics, performance and ease-of-use. The new MiMiC Server release provides multi-user support to...
Micro Focus has announced the availability of Micro Focus COBOL for Eclipse, encompassing versions of Micro Focus' Net Express and Server Express solutions designed specifically for the Eclipse open source ecosystem. Micro Focus COBOL for Eclipse provides an integrated development en...
NewerTech has announced the new Voyager Q Hard Drive Docking Solution. The Voyager Q turns any 2.5" or 3.5" Serial ATA (SATA) I/II up to 2.0TB hard drive into a fully bootable and hot-swappable external drive solution and features four interfaces: FireWire® 800, FireWire 400, USB 2.0...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

Click Here

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING NEWS FROM THE WIRES
Microsoft Dynamics solutions, which serve as essential technology for manufacturers and distributors...