Building COM/COM+ components in the Project painter

You build PowerBuilder COM servers in the Project painter.

If you did not create a project when you created the user object, you can use the COM/COM+ Project wizard to create one. You can also set up a project to build a COM component directly in the Project painter by selecting the COM/COM+ Component icon on the Projects tab.

If you have already created a COM/COM+ project for one or more of the objects you want to build into a COM server, you can modify it in the Project painter, adding additional objects if necessary.

The Project painter workspace is a read-only display that shows the options you selected in the wizard or in the Select Objects and Properties dialog boxes in the painter. When you build a PowerBuilder COM server, the workspace also displays an object inspection report and the status of each phase of the build process.

StepsTo define and build a PowerBuilder COM server project:

  1. Select COM/COM+ Component Wizard from the Projects tab in the New dialog box.

  2. Specify project properties including the project’s name and location.

  3. Select one or more objects that you want to build into a server.

  4. Specify the properties of each object and optional COM+ deployment options and click Finish.

    For help specifying properties, see the context-sensitive Help in the wizard or the following topics:

    Property

    For information see

    Interface options

    “Choosing a custom or dual interface” and “Instance variables”

    Build options

    “Setting up the embedded PBD”

    Registering components

    “Registering components automatically”

    COM+ deployment and package options

    “Deploying components to COM+”

    COM+ transaction settings

    “Specifying whether a component supports transactions”

    COM+ security

    “Security issues”

  5. Select File>Open and select the project you just created to open the Project painter.

    You can verify that the correct objects are selected by selecting Edit>Select Objects from the menu bar.

  6. Select Edit>Properties to verify and optionally modify the properties you set in the wizard.

    Some advanced COM+ package properties can be set only in the Project painter.

  7. Click the Build button in the Project painter to build the PowerBuilder COM server.

    The build process creates an IDL file and a PowerBuilder COM server (DLL) containing a PowerBuilder COM object for each user object you selected. If you specified deployment to COM+ and it is installed and running on the computer where you are generating the component, the component is deployed directly to the server, and additional deployment files can be created.

    The PowerBuilder COM server also contains an embedded PBD file that contains the custom class user objects and any additional objects they reference, and an embedded type library.

NoteBuilding a project after calling an object When you call a COM object in the development environment, the COM object stays in memory until you exit PowerBuilder, because it is hosted in the same process as PowerBuilder. If you make a change to the object after calling it and try to regenerate it in the Project painter, you receive compile and link errors. Before you build the project, shut down and restart PowerBuilder to free the object from memory.