Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Building an executable file and dynamic libraries – PB Docs 70 – PowerBuilder Library

Building an executable file and dynamic libraries – PB Docs 70

Building an executable file and dynamic libraries

Once you have completed development and defined your project,
you build the project to create the executable files and all specified
dynamic libraries. You can build your project anytime you have made
changes to the objects and want to test or deploy another version
of your application.

proc.gif To build the application:

  1. Open the project you built in the Project
    painter.

    The Project painter workspace displays.

  2. Click the Build button in the PainterBar.

    or

    Select Design>Build Project.

    note.gif If the application’s library list has changed When you click Build, PowerBuilder checks your application’s
    library list. If it has changed since you defined your project, PowerBuilder updates
    the Project painter workspace with the new library list. Make whatever changes
    you need in the workspace, then click Build again.

    PowerBuilder builds the executable and all specified dynamic
    libraries.

What’s next

The next two sections describe in detail how PowerBuilder builds
the project and finds the objects used in the application in detail.

Once PowerBuilder has built the application, you can check which
objects are included in the application. See “Listing the objects in a
project”
.

How PowerBuilder builds the project

Here is what happens when PowerBuilder builds your application
project:

  • If you selected
    Rebuild: Full, PowerBuilder first regenerates all the objects in the
    libraries.
  • If you selected Prompt for Overwrite, PowerBuilder displays
    a message box asking for confirmation before overwriting the executable
    file and each dynamic library.

To create the executable file you specified, PowerBuilder searches
through your application and copies the compiled versions of referenced
objects
from the libraries in the application’s library search
path into the executable file. It does not copy objects that are not
referenced

in the application to the executable file.

Nor does it copy objects to the executable file from libraries
you declared to be dynamic libraries. These objects are linked to
the application at execution time; they are not stored in the executable
file. Instead, PowerBuilder creates a dynamic library for each of
the specified libraries and maintains a list of all the dynamic
library files that were specified for the application (PowerBuilder maintains
the unqualified filenames of the dynamic library files; it does
not save the pathname).

note.gif What happens during execution When an object such as a window is referenced in the application, PowerBuilder first
looks in the executable file for the object. If it doesn’t
find it there, it looks in the dynamic library files that are defined
for the application. For example, if you specified that test.pbl
is a dynamic library, PowerBuilder looks for test.pbd or test.dll
at execution time. The dynamic library files must be in the search
path. If PowerBuilder can’t find the object in any of the dynamic
library files, it reports an execution-time error.

How PowerBuilder searches for objects

When searching through the application, PowerBuilder doesn’t
necessarily find all the objects that are used in your application
and copy them to the executable file. This section describes which
objects it finds and copies and which ones it doesn’t.

Which
objects are copied to the executable file

PowerBuilder finds and copies the following objects to the executable
file.

Objects that are directly referenced in scripts For example:

  • If a window
    script contains the following statement:

    Then w_continue is copied to the executable file.
  • If a menu item script refers to the global function
    f_calc:

    Then f_calc is copied to the executable file.
  • If a window uses a popup menu through the following
    statements:

    Then m_new is copied to the executable file.

Objects that are referenced in painters For example:

  • If a menu
    is associated with a window in the Window painter, the menu is copied
    to the executable file as a result of the window being copied.
  • If a DataWindow object is associated with a DataWindow
    control in the Window painter, the DataWindow object is copied to
    the executable file.
  • If a window contains a custom user object that includes
    another user object, each user object is copied.
  • If a resource is assigned in a painter, it is copied
    to the executable file. For example, when you place a Picture control
    in a window in the Window painter, the bitmap file you associate
    with it is copied.

Which objects are not copied to the executable file

When creating the executable file, PowerBuilder can identify
the associations you made in the painter (because those references
are saved with the object’s definition in the library)
and direct references in scripts (the compiler saves this information).

But it does not identify objects that are referenced dynamically
through string variables (it would have to read through all the
scripts and process all assignment statements to uncover all the
referenced objects).

For example:

  • If the
    DataWindow object d_emp is associated with a DataWindow
    control dynamically through the following statement:

    Then d_emp is not copied to the executable file.
  • If a resource is assigned dynamically in scripts,
    such as:

    Then FROWN.BMP and SMILE.BMP are not copied to the executable file.
  • If a window script has the following statements:

    Then the reference to window w_go is not
    found
    by PowerBuilder when building the executable file, so w_go
    is not copied to the executable file.

Which objects are not copied to the dynamic libraries

When building a dynamic library, PowerBuilder does not inspect
the objects; it simply copies the compiled form of the objects.
Therefore, the DataWindow objects and resources (pictures, icons,
and pointers) used by any of the objects in the library–either
specified in a painter or assigned dynamically in a script

–are
not copied into the dynamic library.

For example, suppose TESTDW.PBL contains DataWindow objects
and TESTW.PBL contains window objects that reference them, either
statically or dynamically. If you build a dynamic library from TESTW.PBL,
you must either include the DataWindow objects in a PowerBuilder resource
file that is referenced by TESTW.PBL, or build a dynamic library
from TESTDW.PBL, as described in “How to include the objects
that were not found”
.

How to include the objects
that were not found

If you didn’t use any of the types of references
described in the preceding sections, you don’t need to
do anything else to ensure that all objects get distributed: they
were all built into the executable file. Otherwise, you have the following
choices for how to include the objects that were not found.

Distributing resources For resources such as icons and bitmaps, you have two choices:

  • Distribute them separately.
  • Include them in a PowerBuilder resource file, then
    build an executable file or dynamic PowerBuilder library that uses
    the resource file.

Distributing DataWindow objects For DataWindow objects, you have two choices:

  • Include them in a PowerBuilder resource file, then
    build an executable file or dynamic PowerBuilder library using the
    resource file.
  • Build and distribute a dynamic library from the
    PBL that contains the DataWindow objects.

Distributing other objects All other objects (such as windows referenced only in string
variables) must be included directly in a dynamic PowerBuilder library.

The following table summarizes distribution possibilities:

Object Separately Through resource file Directly in dynamic library
Resource X X
DataWindow object X X
Other object X

For information about distributing resources,
see “Distributing resources “.

For information about dynamic PowerBuilder libraries,
see “Using dynamic libraries “.

Listing the objects in aproject

After you have built your project, you can display a list
of objects in the project.

proc.gif To list the objects in a project:

  1. Build your project.

  2. Select Design>List Objects from the menu
    bar.

    The List Objects dialog box displays listing the objects that PowerBuilder placed
    in the executable file and the dynamic libraries it created when
    it built the project..

    exe06.gif

What’s in the report

The report is a grid DataWindow object with the following
columns:

Column Meaning
Library Name Source library that contains the object
Object Name Name of the object
Object Type Type of object

What you can do

Because the report is a grid DataWindow object, you can resize
and reorder columns just as you can in other grid DataWindow objects.

You can also sort the rows and print the report using the
Sort and Print buttons.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x