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.
To define and build a PowerBuilder COM server
project:
Select COM/COM+ Component Wizard from the Projects tab in the New dialog box.
Specify project properties including the project’s name and location.
Select one or more objects that you want to build into a server.
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 |
|
Registering components |
|
COM+ deployment and package options |
|
COM+ transaction settings |
|
COM+ security |
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.
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.
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.
Building 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.