Building the dynamic libraries

The User’s Guide describes how to build dynamic runtime libraries (PBDs). The procedure is the same for a plug-in application. This section highlights the choices you need to make for building a PBD for a plug-in application.

Remember that in the Web environment, file size is important.

Organizing objects in PBLs

Before you build your application, you should use the System Tree or Library painter to organize the objects your application uses in PBLs, which are the sources for the plug-in application’s PBDs. The following suggestions can help you optimize the resulting libraries:

Using PowerBuilder resource (PBR) files

Several controls can use external files for images. These include PictureListBox, TreeView, Picture, and PictureButton controls, pointers, and bitmap objects in DataWindow objects. If your application uses external files for the images, it is unlikely that the client has the same images on the same system path.

Instead of finding some way to install the pictures on client machines, you can use one or more PowerBuilder resource (PBR) files so that the images are built into the PBDs. The resulting PBDs are larger but self contained.

Because you are building a dynamic runtime library, not an executable, you do not need to include DataWindow objects in the PBR file. All PowerBuilder objects in the source PBL are included in the resulting PBD.

NoteImages and other resources on a network Instead of building the files into the PBD, you can put the files in a generally accessible network directory, but the path to the files must be identical to the path named in the PowerBuilder objects. This means that in the Windows environment, each client must use the same drive letter to map the network drive, or you can specify the server name in the path.

StepsTo define a PBR file:

  1. Open the PowerBuilder File Editor (Shift+F6) or some other text editor and create a new file with the extension PBR. (You can add the File Editor icon to the toolbar.)

  2. List each image or other resource on its own line. List the path and file name exactly as it is named in the object property sheet or script.

    NoteShortcut Look at the object’s Properties view and use Ctrl+C to copy the file name to the clipboard, then paste it into the editor.

  3. Save the file.

If your application includes several PBLs, each with objects using their own resources, you should create a PBR file for each PBL. The PBR file will list file names for resources that are used in one PBL.

Building the PBDs

Build your runtime libraries (PBDs) in the Project or Library painter as described in the User’s Guide. Keep in mind:

For instructions on defining a PBR file and building your runtime libraries (PBDs), see the chapter on creating an executable in the User’s Guide.