Building a Control Panel Application (Windows Embedded CE 6.0)

1/6/2010

For the OS to recognize a DLL as a Control Panel application, the file must be built for the correct hardware platform and be named with a Control Panel (.cpl) file extension.

As described in Control Panel, the .cpl file must also reside in the \Windows directory on the device for the OS to recognize it, but this is the default build behavior so there is nothing to set.

Note

The following steps describe how to make build settings conform to what should already be their default values. Nevertheless, because the context-sensitive nature of many controls allows you to set the same build parameter to different values for different projects, you should still complete all of the steps.

To build your projects for your OS design

  1. In the Solution Explorer window, select the Subprojects node.

    This sets your application projects to be the build context for Platform Builder.

  2. From the Project menu, select <ProjectName> Properties.

  3. Click Configuration Manager. The Configuration Manager dialog box appears.

  4. In the Active solution configuration dialog box, choose the release configuration.

    HelloCPL becomes the active project.

    Although you picked a configuration for only one project, your other projects are also set to that same configuration. You can verify this if you have the Build toolbar docked in your IDE. For more information on displaying or hiding toolbars, see your IDE documentation.

To change the file extension of your output file from dll to cpl

  1. In the Solution Explorer window, Expand the Subprojects node.

  2. Right-click the HelloCPL project and choose Properties.

  3. Select the General tab in the dialog box that appears. In the Custom Variables field, click the ... button to open the Custom Variables box.

  4. Click the New button. In the Environment Variable dialog box, type CPL in the Variable name text box, and 1 in the Variable value text box. To close the Environment Variable dialog box, choose OK, and to close the Custom Variables dialog box, choose OK.

    This will force the HelloCPL application name to have a .cpl extension instead of the default .dll extension.

  5. Click the C/C++ tab in the project settings dialog box. To include the appropriate header files, in the Include Directories field, type $(_PROJECTROOT)\cesysgen\oak\inc .

    Close the project settings dialog box by choosing OK.

  6. To open the file, expand the HelloCPL\Parameter files node and double-click HelloCPL.bib. Replace the code in this file with the following code

    MODULES
    HelloCPL.cpl $(_FLATRELEASEDIR)\HelloCPL.cpl           NK
    

To verify that HelloCPL is set to export functions as a DLL

  1. In the Solution Explorer window, right-click the HelloCPL project and choose Properties.

  2. Select the C\C++ tab.

  3. Verify that the Additional MacroDefinitions field is set to $(CDEFINES) -DHelloCPL_EXPORTS.

  4. Set the DLL Entry Point field to DllMain.

  5. To close the Editing dialog box, click OK.

To build the HelloCPL application

  1. To build the HelloCPL project, from the Build menu, select the following items, in this order:

    1. Clean <ProjectName>
    2. Make Run-Time Image
    3. Build All Subprojects

See Also

Concepts

How to Implement a Control Panel Application

Other Resources

Subproject Settings Dialog Box
Subprojects: Link Settings
Subprojects: C/C++ Settings