PFC Guide Titlebar
HomeFAQLinksPFCMAGExtensionsDownloadWhat's NewSearch

Executable Creation and Deployment


Table of Contents

  1. What files do I need to deploy with my PFC application?
  2. Any tips on creating a new PFC EXE?

Why does PowerBuilder regenerate objects in PFC libraries during rebuild?

There are two types of relationships between PB objects that may force the regeneration of all the related objects. Inheritance and association. Inheritance is obvious, if there was a change in the ancestor, the descendants have to be rebuilt. Association (instance variables) may not be as obvious. I think starting with PB4 there was a change affecting what gets saved in the pbl. In order to improve performance in addition to p-code PB also saves a snapshot of function definitions in all the related objects. Remember that warning you get when you change a function definition in an object?

Here is what it means when translated to PFC. If you change w_master in the extension layer all of it's descendants in PFC layer have to be regenerated. These are pfc_w_sheet, pfc_w_frame, etc... What may not be as obvious is that if you change a function definition in a transaction object - n_tr, all other objects that have instance variables of n_tr type (pfc_u_dw is one) have to be regenerated. From that point on each of these objects will carry a snapshot of what n_tr looked like at that point in time. If later you change n_tr without rebuilding all the related objects you will most probably cause a GPF.

Back to Top

What files do I need to deploy with my PFC application?

In addition to the standard PowerBuilder Deployment DLLs PFC based applications require the following files:

16 bit applications

  1. PFCCOMM.DLL
  2. PFCFLSRV.DLL

32 bit applications

  1. PFCCOM32.DLL
Back to Top

Any tips on creating a new PFC EXE?

Contributed by Sharon Buntz

  1. Mark ALL PBLs as PBDs/DLLs - That's PFC/PFE and all others as well... Only your first PBL should not be marked as such, and all that it should have is the application object (plus the project object).
  1. Make sure that all of your PBLs have read/write access. (See FAQ above relating to how PFC/PFE PBL objects are regenerated during a build.)
  1. If you are compiling to Machine Code, be sure to check the "Error Context Information" box in your "Code Generation Options" within your Project for your Build. Otherwise, if your user gets a PowerBuilder runtime error, no information about where the error occurred will be displayed. For example, without the box checked an error would look like this:
Error Number 2
Error text = Null object reference
Window/Menu/Object = <no group>
Error Object/Control = <no class>
Script = <no rout>
Line in Script = 0
  1. You may have better success switching to compiling to P-code vs.machine code since P-code is much stabler and does not really run that much slower. However, some companies have continued to use machine code and have not run into any problems.

    The biggest advantage to switching to P-code is that your builds will take considerably less time - up to ten times faster! Also the .PBDs are half the size of the .DLLs. In addition, the .PBDs may be shared between a 16-bit and a 32-bit executable (as well as across platforms).
  1. Before building, first regen KEY items that you believe may have been changed or affected, such as the application object (refers to the application manager, n_tr, n_msg, etc), the application manager, etc.
  1. Upgrading your machine's memory to 64MB dramatically improves build turnaround.
  1. After the build is done, don't forget to go round up all the parts (EXE/DLLs/PBDs)... They do not end up in the same directory afterwards; each DLL ends up whereever the source PBL was. This is a common thing that PFC programmers forget to do after they complete their build and are ready to unit test the new EXE. Then they end up with an error such as...

    ...and they go off on wild tangents trying to figure out why. Many times it's just because the newly created DLLs/PBDs were not moved to the appropriate directories - ones in the system or application path (in the registry) so they can be found when running the EXE.

  2. When you deploy, make sure that you include all of the parts of your application (EXE/DLLs/PBDs), as well as the PowerBuilder runtime DLLs, the PFC runtime DLLs, and any other necessary files (see quick checklist below). In addition, again, if you deploy your files into different directories, make sure that the system or application path (in the registry) knows where to find them. It is best to test running your setup/install program on a virgin machine that does not have anything like PowerBuilder or your application already installed on it. Then you will know that you have included all the pieces.
    Quick Checklist - Objects to deploy
    • Application EXE
    • Application PBDs/DLLs
    • .INI files
    • .HLP Help files
    • All Bitmaps (.BMP) and Icons (.ICO) [which were not included in your .PBR file]
    • MSVCRT40.DLL (Microsoft DLL needed to execute the .EXE)
    • PowerBuilder runtime DLLs
    • PFC runtime DLLs
    • Database runtime DLLs and DB engine (if applicable)
    • ODBC Connectivity Drivers DLLs (if applicable)
    • Any needed runtime DLLs for any OLE/OCX/ActiveX's (PowerBuilder and/or Component DLLs)
    • Any needed .LIC licence files (for any OLE/OCX/ActiveX's, etc)
    • Any other programs called directly or used via OLE/OCX/ActiveX's, e.g. CALC.EXE and NETSCAPE.EXE
    • Plus, don't forget your registry entries for any OLE/OCX/ActiveX's, ODBC and application user settings

Other resources:


Back to Top

Contributed by PFCGuide staff, except where noted otherwise.
PFCGuide is sponsored by Dynamic Technology Group
The information provided is for advice only and not to be considered a contract or a liability against Dynamic Technology Group.

Last revised: February 15, 2004 03:58 AM.