Building a Control Panel Application (Windows CE 5.0)

Send Feedback

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 Workspace view, choose the FileView tab.

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

  2. From the Build OS menu, choose Set Active Configuration.

    The Set Active Configuration dialog box appears.

  3. In the Set Active 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, see Displaying or Hiding Toolbars.

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

  1. In the Workspace view, choose the FileView tab.

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

  3. Choose 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. Right-click the HelloCPL project and choose Settings.
  2. Choose 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 project settings dialog box, choose OK.

To build the HelloCPL application

  1. From the FileView tab in the workspace, select the HelloCPL project.
  2. To build the HelloCPL project, from the Build Project menu, make sure that the following are selected:
    1. Clean Before Building
    2. Make Run-Time Image Before Build
    3. Build Current Project

See Also

How to Implement a Control Panel Application | Project Settings Dialog Box | Link Tab | C/C++ Tab

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.