Tech Articles


Interfacing PB Applications with the Windows API - Part 2


This tutorial discusses how to interface traditional, Windows-hosted PowerBuilder 32-bit and 64-bit applications with the Windows Application Programming Interface (API), also known as the WinAPI. Much of the information presented here also applies to interfacing with DLL’s created in-house or by third-party vendors, because the interface mechanism in PB is the same. The focus, however, will be on interfacing to the WinAPI.

* * * Part two content has been revised and expanded from the original version * * *

Read more

Interfacing PB Applications with the Windows API - Part 1


This tutorial discusses how to interface traditional, Windows-hosted PowerBuilder 32-bit and 64-bit applications with the Windows Application Programming Interface (API), also known as the WinAPI. Much of the information presented here also applies to interfacing with DLL’s created in-house or by third-party vendors, because the interface mechanism in PB is the same. The focus, however, will be on interfacing to the WinAPI.

* * * Part one content has been revised and expanded from the original version * * *

The tutorial is presented in four parts. Part one covers External Function Declarations in PB and explores issues related to interfacing with the WinAPI. The second part examines the calling conventions in 64-bit Windows and important differences between the 32-bit and 64-bit environments. Part three looks at several factors that can affect the interfacing of PB applications with the WinAPI, such as null values, PB datatypes not supported by Windows, the PB Any datatype, unbounded arrays, nested structures and arrays of nested structures. The tutorial concludes in part four beginning with the description of an available free PB sample application and non-visual object that can dynamically determine the memory size and layout of a structure in either 32-bit or 64-bit environments. Part four also contains a list of coding tips & techniques to help you develop PB applications that interface with the WinAPI, and includes mapping tables to assist in the translation between many common WinAPI datatypes and the standard PB datatypes.

Read more

How to use Visual Studio to debug a C/C++ dynamic library called by a PowerBuilder 2019 application


Background

This article aims to give an instruction on how to use Visual Studio to debug a C/C++ dynamic library that is called by a PowerBuilder 2019 application.

Here we will show you:

  • How to create a C/C++ dynamic library.
  • How to call this DLL in PowerBuilder application.
  • How to debug the DLL called by the PowerBuilder application.

Description

Let’s take Visual Studio 2017 as an example to create a C/C++ dynamic library NewDLL.dll, which contains two functions:

  • Add: Accepts two int parameters.
  • ComputerName: Accepts a string parameter.

In addition, we will create a simple application with PowerBuilder 2019 to call this NewDLL.dll.

Read more

Quick start for contributing to Open Source PFC


Given that not everyone is fluent in using Git and or Github (where the Open Source PFC is hosted now), I put together a quick introduction in how to get started.  The video below walks through the steps, which in summary are:

  • Create a GitHub account if you don't already have one.  https://github.com/join
  • Navigate to the Open Source PFC and "Fork" a copy of the code into your account.  The 2019 version of the PFC can be found at: https://github.com/OpenSourcePFCLibraries/2019
  • Chose Code -> Clone and copy the HTTPS URL for your fork.
  • Open the PowerBuilder 2019 IDE and with no workspace open select File -> Connect to Workspace.
    • Source Control System:  Choose Git
    • Repository URL: Paste in the URL you copied above
    • Workspace File: Give it any name you choose
    • User ID:  Your Github user id (normally your email address)
    • Password:  Your Github password
    • Checkout Directory:  Select or create a new empty subdirectory on your local machine for the code to be copied to
  • Wait until the source code is downloaded and refreshed (12 to 15 minutes)
Read more

A Simple Methodology for Complex Resizing Scenarios Using the PFC


The Resize service included in the PowerBuilder Foundation Class (PFC) framework is a powerful, yet easy-to-use tool in the developer’s toolbox. Due to several factors, however, many PB developers struggle to make the Resize service perform as they would like, particularly when the layout of window controls and/or the desired resizing behavior steps become non-trivial… and often the developer ends up getting frustrated. As a result, the desired functionality is frequently omitted or severely curtailed.

The issue is not that the Resize service is unable to perform the desired task(s) – I believe it can, in many (perhaps not all) cases. The real issue is learning how to effectively utilize the functionality that already exists. There admittedly is not a lot of instructional material available on how to use the PFC in general and the Resize service in particular, so I’ve created an easy-to-follow methodology you can use to make the Resize service do what you want instead of the Resize service making you to do what it wants.

As you’ll soon see, the steps I describe in this tutorial are simple, yet they can be quickly applied to complex resizing scenarios. I’m also going to give you some free code that implements a couple of handy resize-related features you may want to add to your projects.

Read more

Tips on Using Git with PowerBuilder


Many PowerBuilder developers want to try Git as it gains in popularity. However, as PowerBuilder IDE still relies on the binary PBL format instead of directly working with the plain text source code files, the implementation of native Git support comes with some special features that you may need to be aware of in order to use Git properly or to work around some of the limitations. This article tries to give some tips in this area.

Read more

Pushing large projects to Git server


Symptom

When you push your repository from PowerBuilder IDE to your Git server for the first time after you do the Add to Source Control, it may fail when the size of your source code is large and/or your network is slow. 

Read more

Find Articles by Tag

SQL Server Branch & Merge 64-bit Azure TFS License COM Platform Oracle WinAPI Database Table SqlExecutor Import DataWindow JSON REST Import JSON Validation Repository Elevate Conference Debugger Performance IDE Windows OS Database Table Schema File GhostScript OrcaScript Web API CrypterObject Event Handler Git TreeView OAuth 2.0 CI/CD Database Object Testing Database Painter DataType Android Encryption Outlook Trial DevOps SQL Menu OLE PBDOM Jenkins Graph PostgreSQL ODBC driver PowerScript (PS) SDK DataWindow RibbonBar DLL Mobile SnapDevelop Database Profile InfoMaker Web Service Proxy UI Modernization Design Transaction SnapObjects Array Expression Script Bug PowerBuilder (Appeon) JSONGenerator Source Code PDFlib Database Icon BLOB Syntax C# SVN TortoiseGit DragDrop Text PDF Resize Export JSON NativePDF XML TLS/SSL .NET Assembly 32-bit UI ActiveX External Functions Sort Interface Excel API PowerBuilder Compiler PowerServer Mobile HTTPClient JSON Variable Deployment Application Service Installation Windows 10 Icons MessageBox Error .NET Std Framework Authentication Migration Event SqlModelMapper RichTextEdit Control iOS .NET DataStore SOAP JSONParser PostgreSQL Automated Testing Database Connection Filter Authorization PFC Charts PowerBuilder Open Source Database Table Data ODBC Export Model Class RibbonBar Builder WebBrowser UI Themes Data Debugging Stored Procedure Source Control CoderObject Encoding Window PowerServer Web OAuth Messagging Linux OS Event Handling RESTClient Configuration Debug