Adding an Object

After you create your project, you compile the files that Microsoft Visual C++ created for you into a dynamic-link library (DLL). To make this DLL useful, however, you must add support for an object that implements the appropriate pipeline interfaces.

When you use the ATL Pipeline Component Wizard to add an object to your project, the IPipelineComponent interface is implemented by default. In addition, you can choose to implement the ISpecifyPropertyPages, IPersistStreamInit, and IPipelineComponentDescription interfaces. For more information about which interfaces to implement, see Pipeline Component Interfaces.

Ee825352.note(en-US,CS.10).gif Note

To add an object to your project

  1. In your project in Visual C++, on the Insert menu, click New ATL Object.

  2. In the ATL Object Wizard dialog box, do the following:

    Use this To do this
    Category Select Objects to add a new pipeline component.
    Objects Select Commerce Component.
  3. Click Next.

  4. In the ATL Object Wizard Properties box, on the Names tab, do the following:

    Use this To do this
    C++ Short Name Type the name of your component.
    C++ Class Type the class name to implement the control, or leave the default value.
    C++ .H File Type the name of the .h file, or leave the default value.
    C++ .CPP File Type the name of the .cpp file, or leave the default value.
    COM CoClass Type the name of the component class for the object, or leave the default value.
    COM Interface Type the name of the interface on which the component will implement its custom properties, or leave the default value.
    COM Type Type the description for the control, or leave the default value.
    COM ProgID Type the name of the ProgID, or leave the default value.

Ee825352.important(en-US,CS.10).gif Important

  - Do *not* click **OK** until you configure the **Commerce Component** tab.
  1. Click the Commerce Component tab. (This tab displays a list of the optional interfaces that you can implement on a Commerce Server pipeline component.)

  2. In the ATL Object Wizard Properties dialog box, on the Commerce Component tab, do the following:

    Use this To do this
    ISpecifyPropertyPages Select if your component uses property pages to allow users to set component properties.
    IPersistStreamInit Select if your component saves and loads its properties to and from a stream.
    IPipelineComponentDescription Select if you want your component users to identify the OrderForm object or pipe context values that your component reads and writes.
  3. Click OK.

The ATL Object Wizard creates the definition and implementation files that implement the necessary pipeline interfaces, and adds these files to the project.

In addition, the ATL Object Wizard creates a stub implementation for the object interface, on which you implement the properties for your component.

Ee825352.note(en-US,CS.10).gif Note

  • The approach to adding properties described in this section assumes that you do not intend to implement the IPipelineComponentAdmin interface. However, Commerce Server defines this interface as an alternative way to implement properties on an object.

See Also

Deciding Which Interface to Expose

Enhancing Component Usability

Implementing the IPipelineComponent Interface

Registering the ATL Component

Active Template Library

MinMaxShip Sample Pipeline Component


All rights reserved.