Novalys, your PowerBuilder Specialist


64-Bit Windows Applications

Create 64-bit native applications in PowerBuilder Classic.

Usage

There is no special target for 64-bit native applications. To build a 64-bit application, select the platform in the Project painter General tab. If you need to deliver both 32-bit and 64-bit versions of your application, you should use separate projects and separate folders for the deployed output.

There is no IDE for 64-bit development. Design time uses the same 32-bit interface and 64-bit features display at runtime when you deploy the application. When you click the running man button, the project runs as a 32-bit application.

32-bit remains the default for new and migrated applications.

During the deploy process, PowerBuilder checks and reports unsupported features used in the application.

New Property for Environment Object

The new ProcessBitness property identifies whether the application is a 32-bit or 64-bit process.

Datatype
integer
Values
32 stands for 32-bit, and 64 stands for 64-bit

See Objects and Controls for more about the Environment object. See the PowerScript Reference to read about the GetEnvironment function.

New Datatype

The longptr datatype is 4 bytes in the 32-bit platform and 8 bytes in the 64-bit platform. In the 32-bit platform, longptr is the same as long; you can continue using long wherever longptr is required in 32-bit applications. In 64-bit applications, however, using long to hold longptr variables will lead to data truncation from 8 bytes to 4 bytes, or memory corruption if you pass a

long
ref variable when a longptr ref is required. If you want to move to 64-bit, use longptr wherever required. It does no harm to 32-bit.

Since PowerBuilder does not have a datatype corresponding to the C++ pointer type, and there are no pointer operations in PowerBuilder, longptr is not a full-fledged PowerBuilder datatype. You can use it to hold/pass window handles, database handles, and other objects that are essentially memory addresses. Doing complex operations on longptr type might not work. If you want to represent/compute 8-byte long integers, uselonglong.

System Requirements

The design time environment requires:

  • Windows SDK for Windows 7 or later
  • .NET Framework 4.0 or later
  • 64-bit Windows OS to test (development requires only 32-bit)

The runtime environment requires:

  • 64-bit Windows OS
  • PowerBuilder 12.6 64-bit system files
  • 64-bit third-party libraries, such as database drivers and external DLLs
  • Greater than 4 GB physical memory to avoid performance issues

Limitations

There are limitations to this new feature:

  • To consume Web services, you must use the .NET engine. EasySOAP is not supported.
  • You can use OLE and ActiveX components in your applications, but you must use the 32-bit versions in the PowerBuilder Classic IDE. At runtime you must have the correct 64-bit ActveX components installed.
  • The RichText DataWindow header does not display when the HeaderFooter property is true until you callShowHeaderFooter(true). If you do not:
    • selecttext ( long l1, long c1, long l2, long c2, band b Header! ) returns 0 and selected text is '' (string with 0 length)
    • selecttext ( long l1, long c1, long l2, long c2, band b Footer! ) returns 0 and selected text is '' (string with 0 length)
    Regardless, autofocus does not work.
  • Scrolling in a RichText DataWindow loses focus.
  • CopyRTF(false,header!) works only when you call ShowHeaderFooter(true) when Header/Footer is true
  • InsertDocument("*.htm",true) returns -1
  • InsertDocument("*.doc",true) returns -1
  • Position returns the header when the footer is in focus
  • SaveDocument (string f, {FileTypeDoc!|FileTypeHTML!|FileTypePDF!}) retuns -1 and FileExists event is triggered

Unsupported Features

These features are not supported:

  • COM+ runtime
  • Machine code generation
  • TabletPC
  • PBNI SDK for developing 64-bit PowerBuilder extensions
  • DataWindow RichText style column
  • DataWindow Web control for ActiveX
  • Status bar
  • Grid table
  • ClearAll() function
  • Clear(true) function
  • Change Pointer does not work on RichTextEdit controls
  • Mouse wheel does not scroll a RichTextEdit page
  • Application server support

Also, if you select Properties in the RichTextEdit Object Dialog popup menu, the application crashes if you select the Print Spec tabpage and click OK.

Behavior Differences

Some things are not problematic, simply different:

  • The RichText preview mode behaves differently; in 64-bit, it is more like a print preview

PowerBuilder Native Interface (PBNI)

You can only use 32-bit PowerBuilder extensions in the PowerBuilder Classic IDE. For runtime, package and distribute 64-bit extension libraries with your 64-bit applications. The file names of your 64-bit extension should match the 32-bit file names, since the application references it by file name.

OrcaScript

To build 64-bit native applications with OrcaScript, use the new X64 option to build executable commands. For example:

build executable exeNameiconNamepbrNamepbdflags x64