Converting a PowerBuilder application

PocketBuilder has wizards for importing PowerBuilder targets as PocketBuilder targets and exporting PocketBuilder targets as PowerBuilder targets.

If you plan to convert an existing PowerBuilder application to PocketBuilder, however, you should make as many modifications as possible prior to migration. The target conversion is more likely to succeed if you make initial changes to targets in PowerBuilder. This will help you avoid spending time after the migration fixing multiple compile errors due to third-party controls or MDI dependencies.

The recommended conversion strategy is therefore:

  1. In PowerBuilder, duplicate the entire target and cut out the features that you know will not work or that are inappropriate for the Windows CE environment.

    These include features such as the use of MDI windows, large-sized windows, OLE and RichText controls, and CORBA and other distributed processing.

  2. When you are satisfied that your application conforms reasonably well to requirements of the Windows CE environment, use the Import Desktop to Pocket wizard on the Target page of the New dialog box in PocketBuilder. (This wizard is not available in PowerBuilder.)

    The wizard prompts you for the PowerBuilder target you want to convert.

You can use PowerScript targets from PowerBuilder versions 7 through 11. The Import Desktop to Pocket wizard copies and converts all the PBL files in the target that you select on the first page of the wizard into PKL files, and it references the PKL files in a new target with a PKT extension. The original target and libraries are left in their original directories, which is also where the new target and migrated libraries are saved.

The conversion wizard gives you the option of adding the new target to the current PocketBuilder workspace.

Files converted by the wizard keep the same names as the original files, except for their extensions. The PowerBuilder VM for your source files (target and PBL files) must be in your machine's PATH variable. The wizard uses the PBVMxx.DLL and the compiler PBCMPxx.DLL to convert the source files, where xx is the version of the build.

Generating an application that is not in the current workspace can cause compile errors during the conversion of PBL to PKL files. However, once the application has been added to a workspace, a full rebuild typically fixes everything except for true compile errors.

For information on the Export Pocket to Desktop wizard for converting a PocketBuilder application to a PowerBuilder application, see “Converting a PocketBuilder target to PowerBuilder”.