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.
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:
To minimize file size, include only objects the application uses; remove any objects that are not needed.
Include any objects that are dynamically created, such as DataWindow objects used in DataStores or assigned dynamically to DataWindow controls.
Include ancestor objects.
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.
Images 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.
To define a PBR file:
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.)
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.
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.
Build your runtime libraries (PBDs) in the Project or Library painter as described in the User’s Guide. Keep in mind:
Deselect Machine code Your plug-in application must have PBDs, not machine code DLLs.
Specify a PBR file for each PBD If the objects in the PBL use resources that you have listed in a PBR file, put the PBR name in the Resource File Name text box.
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.