Deploying the PowerBuilder COM server – PB Docs 70

Deploying the PowerBuilder COM server

Once you’ve generated a PowerBuilder COM server, you
can use COM-enabled client applications to create the PowerBuilder COM
objects and access their methods. You can use the server with any
COM-enabled application or deploy it as a package to MTS.

Using a PowerBuilder COM server with a COM-enabled

proc.gif To use a PowerBuilder COM server with a COM-enabled

  1. Deploy the PowerBuilder COM server to the user’s

  2. Deploy the PowerBuilder virtual machine (PBVM70.DLL)
    and any other required modules (such as PBDWE70.DLL or
    any required database software) to the computer containing the PowerBuilder COM

  3. Register the PowerBuilder COM server on the user’s

  4. Write a client application that calls PB object functions
    in the PowerBuilder COM server.

    See “Accessing PowerBuilder COM
    servers from clients”

Registering PowerBuilder COM servers When you deploy a PowerBuilder COM server, you need to add information
to the registry to enable COM to create instances of the server’s
objects. PowerBuilder COM servers are self-registering–you
do not need to create a separate registration file. To register
a PowerBuilder COM server, use the REGSVR32 utility. For example:

If you want to access the server from a remote client, you
need to make an additional change to the registry and you may need
to configure the client for remote access to the server. For more
information, see “Using PowerBuilder COM servers
and objects with DCOM”

note.gif Registering automatically for testing For testing purposes, you can check the box on the General
property page that registers the server on the development computer
automatically when it has been generated. To avoid making unnecessary
registry entries on your computer, check this box only when you
are ready to test the PowerBuilder COM server.

Deploying PowerBuilder COMobjects to MTS

PowerBuilder COM objects can be deployed directly to MTS or
imported into MTS as MTS components.

Server requirements

The server to which you deploy a PowerBuilder COM server needs
the following software and files:

  • MTS 2.0 or
  • NT 4.0 with Service pack 3 or later
  • PowerBuilder COM objects using database connections
    via ODBC drivers (ODBC 3.0 or greater)
  • PowerBuilder deployment DLLs installed and in the
    user’s path
  • PowerBuilder COM server DLL(s) on a local file system

If MTS is installed

If MTS is installed and running on the computer where you
build the PowerBuilder COM server, you can deploy directly to MTS
from the Project painter. You can also create a PAK file that you
can use to import the package into an MTS server on another computer,
and a client configuration utility that adds to a client computer
all the information required to use the components in the package,
including registry information and the component’s type
library. These options are available on the MTS Package property
sheet in the Project painter.

note.gif About registry information If you import the package into an MTS server on another computer,
verify that the path information in both the package and the client
configuration utility is correct. Supporting files such as PBVM70.DLL
may be installed in a different location.

If MTS is not installed

To deploy PowerBuilder COM objects to an MTS server running
on a different computer, you need to complete the following steps:

  1. Deploy files to the MTS
    server computer
  2. Import PowerBuilder COM objects
    into MTS
  3. Create the client deployment
  4. Install the client deployment

Deploy files to the MTSserver computer

Copy the generated PowerBuilder COM server DLL to a directory
on the MTS server computer’s local file system, along with
PBVM70.DLL and any other required PowerBuilder runtime DLLs.

Import PowerBuilder COM objectsinto MTS

To import PowerBuilder COM objects into MTS, you need to select
the computer where you want to deploy the PowerBuilder COM libraries,
create a package, import the objects, set their transaction properties,
and verify that their interfaces and methods display correctly.

proc.gif To select the MTS server computer name:

  1. From the MTS server computer, open the MTS Explorer.

  2. Select and expand the Computers folder.

  3. Select and expand the appropriate computer name folder.

proc.gif To create a new package:

  1. Select the Packages Installed folder.

  2. Select New from the popup menu.

  3. From the Package Wizard dialog box, select Create An
    Empty Package.

  4. Enter a package name.

  5. From the Set Package Identity dialog box, select Interactive
    User or set a specific user name and password.

note.gif Visual content If functions in your custom class user objects inadvertently
display visual content such as a message box, the execution of that
visual content will appear to hang if the component’s user
is set to anything but the interactive user.

proc.gif To import PowerBuilder COM objects as MTS components:

  1. Select and expand the newly created package name

  2. Select the component folder and select New>Component
    from the popup menu.

  3. From the Component Wizard dialog box, select the Install
    New Component icon.

  4. From the Install Component dialog box, select Add Files.

  5. From the File Open dialog box, browse for the COM server
    DLL and select Open.

    The Files To Install listbox is updated showing the PowerBuilder COM server
    DLL name as well as components and typelib indicating that components
    and the embedded type library were found. The Components Found listbox
    displays each component found in the server–for example, PB70.MyComponent.1.

  6. Click Finish.

proc.gif To set MTS component transaction properties:

  1. Select one of the component folders.

  2. Select Properties from the popup menu.

  3. From the Component Properties dialog box, select the
    Transaction tab and set the attribute you want.

proc.gif To verify interfaces and methods:

  1. For each component, select and expand the interfaces
    and methods folders and verify the correct interface names and methods.

Create the client deploymentfile

proc.gif To create an MTS client deployment file:

  1. Select the Package folder you want to export.

  2. Select Export from the popup menu.

  3. From the Export dialog box, select a destination directory
    for the exported package–for example, C:MTSPACKAGES.

    This will create two files with the extensions PAK and EXE.
    The executable file is the client deployment file.

Install the client deploymentfile

proc.gif To install the MTS client deployment file:

  1. Copy the client deployment file to the client

  2. Execute the client deployment file.

The deployment file registers all MTS components as remote
objects running on the designated MTS server computer. Your client
application can now create and execute the MTS components using
the appropriate component names.

note.gif About server location If you move the server to a different computer, you will need
to update registry information on the client.

Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x