Building a Control Panel Application (Windows CE 5.0)
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
In the Workspace view, choose the FileView tab.
This sets your application projects to be the build context for Platform Builder.
From the Build OS menu, choose Set Active Configuration.
The Set Active Configuration dialog box appears.
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
In the Workspace view, choose the FileView tab.
Right-click the HelloCPL project and choose Settings.
Choose the General tab in the dialog box that appears. In the Custom Variables field, click the ... button to open the Custom Variables box.
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.
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.
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
- Right-click the HelloCPL project and choose Settings.
- Choose the C\C++ tab.
- Verify that the Additional MacroDefinitions field is set to
$(CDEFINES) -DHelloCPL_EXPORTS.
- Set the DLL Entry Point field to DLLMain.
- To close the project settings dialog box, choose OK.
To build the HelloCPL application
- From the FileView tab in the workspace, select the HelloCPL project.
- To build the HelloCPL project, from the Build Project menu, make sure that the following are selected:
- Clean Before Building
- Make Run-Time Image Before Build
- 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