User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive

Recently someone asked me how they could get the output from PBDOM used from a PowerBuilder Classic Win32 application formatted with white space as PBDOM doesn’t include it.  I gave them a number of options, particularly MSXML through OLE Automation or using a .Net class like XmlTextWriter.  Normally if you were going to try to access a .Net assembly from a PowerBuilder Classic Win32 application, you would do it via a COM Callable Wrapper.  However, for something this simple I thought there had to be a more lightweight way to accomplish it.  One particular lighterweight way that occurred to be would be to have the application launch a Windows PowerShell script that would then use the .Net class in question.  We’re going to look at an example of how that’s done.

The first thing we’ll need is the PowerShell script to do the work. This is what I came up with (referenced as prettyprint.ps1 in the later code):

param( [string]$filein, [string]$fileout ) [void][System.Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") [System.Xml.Linq.XDocument]::Load($filein).Save($fileout) # If running in the console, wait for input before closing. if ($Host.Name -eq "ConsoleHost") { Write-Host "Press any key to continue..." $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null }

The script declares a couple of parameters (the input xml file and the output xml file).  It then loads the System.Xml.Linq .Net assembly via reflection.  Finally, we load the file and then write it back out again with white space.  The last few lines are just for debugging from a command line prompt, as it displays a “Press any key to continue…” prompt before closing the PowerShell process window.

To test it through a batch file, I used this:

@ECHO OFF SET ThisScriptsDirectory=%~dp0 SET PowerShellScriptPath=%ThisScriptsDirectory%prettyprint.ps1 SET SourceFile=%ThisScriptsDirectory%config.xml SET DestFile=%ThisScriptsDirectory%.config.new.xml %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%PowerShellScriptPath%' -filein '%SourceFile%' -fileout '%DestFile%'"; pause

The assumption here is that the batch file, the PowerShell script and the input xml file are all in the same directory.  I’ve got a pause statement in this script, so you actually get two “Press any key to continue…” prompts.  If it works properly, that’s all you should see.  Otherwise you should see the error message from PowerShell or the batch file.

User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive

We’re going to look at using the Smart Card SDK provided in more recent versions of Windows (XP and later).  Earlier versions of Windows had an ActiveX installed called CAPICOM which could be accessed from PowerBuilder through OLE Automation, but that control was removed as of Windows Vista because of security issues.

We’re going to look at a number of operations:

·         Communication with the card

·         Validating the user’s PIN

·         Reading the certificate Subject Name

·         Reading other certificate data

 

 

Communicating with the card

The first step is establish a context for the API calls.  To do that, we need to declare the following local external function for SCardEstablishContext:

Function ulong SCardEstablishContext  ( &

  Long dwScope, &

  long pvReserved1, &

  long pvReserved2, &

  REF ulong phContext &

  ) Library "winscard.dll"

 

And call it as follows:

ulong    rc

rc = scardestablishcontext( SCARD_SCOPE_USER, 0, 0, context )

IF rc = SCARD_S_SUCCESS THEN

    Return SUCCESS

ELSE

    Return FAILURE

END IF

 

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

​You might think, why should I bother using PBDOM? You can use PDOM to manipulate elements in an XML document. That means you can move elements within a document or from one document to another. You can add elements to a document or delete elements from a document. Moreover, with some coding it is even possible to import nested XML data into a DataWindow.

With the XML capabilities of the DataWindow introduced with PowerBuilder 9 it is possible to import and export data very fast and easily. You might have given a short look at the PBDOM definition in the PowerBuilder help but at the first sight, it looks quite difficult to handle. In the following article, I introduce PBDOM accompanied by some code samples.

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

Frogpond – A study in game design

By: Matt Balent

Presented at the Elevate 2017 conference.

 

This project began as an exercise with two goals: improve my knowledge of the datawindow ‘modify’ method and provide a simple computer ‘game’ for my four year old to use to improve her mouse skills.  When I was thrust into the role of PowerBuilder consultant in 2007 I knew I had to improve my overall skill level with PB in order to be successful.  An area I had not done much prior work was using the ‘describe’ and ‘modify’ methods to alter a datawindow when the application was running.

Over the years I have demonstrated this application at a variety of user group meetings and conference sessions, often as  a way to pass time.  One near universal reaction is ‘I never knew you could do that in PowerBuilder!’  The source code is provided for this (PB2017 format) application.

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

This article is a guide to connect Powerbuilder 2017 with TFS. It is important to follow the steps in the order listed in the article.

The prerequisite includes

  • PB17 installed on a local machine.
  • TFS server running with access to the user. A collection is required where the code will be checked in. 

Next follow the below points:

  1. Team explorer 2013 : Yes the first thing needed is to install Visual studio team explorer. I know the first question pop ups in mind is if Visual studio needs to be installed on every machine !! Well the answer is NO. All you need is Team explorer 2013 to access the TFS. Second question is why 2013 ? Well there comes the 32 bit and 64 bit compatibility issues, moreover there is no standalone installer for Team explorer 2015. If you figured out a way to do it with later versions, then mention it in the comments. 

User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive

This article presents the configuration process of PowerBuilder 12.6 with TFS 2017 (server) using Team Explorer 2013/2015

This article has four sections:

  • Prerequisites.
  • Setup Team Explorer 2013/2015.
  • PowerBuilder Configuration.
  • Complementary Information

 

1. Prerequisites

  1. Verify that the DPI font is 96 (100%) .
  2. Create a new folder on C: drive (C:\MyApp is my example) and copy your application on it.

IMPORTANT: See Numeral 1 of PowerBuilder Configuration section, about folders structure.