Desta logo Desta clients
PBInvoke library
PBInvokeis a PowerBuilder library for calling external DLL functions with arbitrary parameter and return types - structures, unions, pointers, etc. including function pointers to PowerBuilder methods callable from DLL code as callbacks.

PBInvoke goals
  • Allow PowerBuilder developers to work in PowerScript with complex data structures without writing wrapper DLLs in other languages such as C/C++.
  • Make declarations of external functions ANSI/Unicode-independent which avoids migration issues when using the same code across ANSI and Unicode versions of PowerBuilder.
  • Support any C/C++ data type (except classes). This includes complex nested data types involving structs, unions, pointers, simple types and their combinations.
  • Support not only STDCALL calling convention, but also CDECL which is default in C/C++ programs.
  • Allow PB code to be called from external functions as callbacks with full access to passed parameters.
  • Support wide range of PowerBuilder versions from PB 6 to PB 11.5 and any future version.

    Why not use native PowerBuilder external functions?

    PowerBuilder support of external functions has the following restrictions which make developers write wrapper code in C/C++ and compile it with third party compilers.

  • No support for PowerBuilder callbacks.
  • No support for unions and pointers to complex data types in structures.
  • External function declarations depend on string encoding expected by functions. Often a charset conversion is required between ANSI PB and Unicode DLL and vice versa. PowerScript attrubute ';ansi' is available only in PB10+ and makes the source code incompatible with older PB versions. PBInvoke automatically handles the encoding stuff (including function name suffixes such as A/W in WinAPI).

    Why not use PowerBuilder extensions (PBNI)?
  • PBNI is available only as of PB9.
  • PBNI requires knowledge of C++.
  • PBNI extensions are quite hard to write and debug.
  • PBNI requires separate DLLs for ANSI and Unicode versions.

  • This useful PowerBuilder tool is developed by our friend and partner Anatoly Moskovsky

    Demo evaluation

    You may evaluate PBInvoke demo for period of 30 days. After this period you may not use the software unless you pay the registration fee.

    The demo version of PBInvoke works only in PowerBuilder IDE. Compiled applications will not work.

    View License before downloading.

    PBInvoke 1.0.2 Demo [384 Kb]

    There are the following samples:
    Setting starting directory in the "Browse For Folder" dialog.
    This sample demonstrates working with PB callbacks.
    See for details.

    Setting file type filter in the "Save As" dialog.
    This sample demonstrates working with structures, PB callbacks and callback message filters.
    The sample is based on SetWindowsHookEx sample from Codexchange.

    PBInvoke Samples (All PB versions) [1173 Kb]

    If you have questions regarding the evaluation, please, contact Evaluation Support
    PBInvoke library documetation
  • Quick Start Guide

  • Reference
  • Calling DLL functions using PBInvoke
  • Handling strings (char*, wchar_t*)
  • Handling TCHAR and TSTR. Unicode/ANSI function name suffixes
  • Supported data types
  • WinAPI constants and types

  • Advanced
  • Working with C/C++ structures/unions
  • Working with callbacks

  • Reference
  • Unsupported and unimplemented PBInvoke features
  • PBInvoke library license agreement

  • Purchase
    Each license includes:

  • 1 year of free support (bug fixes)
  • free upgrades within the same major version (e.g. 1.0 -> 1.1)
  • a discount of 50% for upgrades to next major version (e.g. 1.X -> 2.X)

    There are 3 license types described in the table below.

  • PBInvoke Single Application License - -
  • USD 95.00
  • PBInvoke Multi Application License - -
  • USD 195.00
  • PBInvoke Library License - -
  • USD 895.00

    If you have questions regarding buying PBInvoke, please, contact Support Service.

    Our secure online shop is powered by Share-It.
    License Agreement
    Thesises of License Agreement:
  • Single Application License. You may create commercial applications based on PBInvoke and distribute them with your executables. No royalties required. One license is required per application. This is enforced by binding PBInvoke to application's executable name. You may NOT create a distributable component/library that include PBInvoke.
  • Multi Application License. You may create commercial applications based on PBInvoke and distribute them with your executables. No royalties required. Any number of applications are allowed with one license. You may NOT create a distributable component/library that include PBInvoke.
  • Library License. You may create unlimited number of commercial applications, components or libraries based on PBInvoke and distribute them in any form, provided the original PBInvoke code is not modified. No royalties required.

     Full version of License Agreement...

    Advertisement: Desta are looking for a contract job...
    Desta are looking for a contract job as distant powerbuilder software engineers (outsourced developers). Our team currently has the manpower resource of 2,000 man-hours monthly and can increase it upon request and/or in case of extensive development that requires extra efforts.
    Please, find our CV at our official site:
    About Desta Company
    Desta is a software company engaged in development and implementation of software in the fields of the accounting (including GAAP) management, financial analysis, HR management, forwarding, agricultural operations, travel business, etc. Many companies and enterprises use our software. Well-considered price policy and rich functionality give us the opportunity to offer flexible and forward-looking solutions.