Building a Control Panel Application (Windows Embedded CE 6.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.
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 Solution Explorer window, select the Subprojects node.
This sets your application projects to be the build context for Platform Builder.
From the Project menu, select <ProjectName> Properties.
Click Configuration Manager. The Configuration Manager dialog box appears.
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
In the Solution Explorer window, Expand the Subprojects node.
Right-click the HelloCPL project and choose Properties.
Select 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
In the Solution Explorer window, right-click the HelloCPL project and choose Properties.
Select the C\C++ tab.
Verify that the Additional MacroDefinitions field is set to
Set the DLL Entry Point field to DllMain.
To close the Editing dialog box, click OK.
To build the HelloCPL application
To build the HelloCPL project, from the Build menu, select the following items, in this order:
- Clean <ProjectName>
- Make Run-Time Image
- Build All Subprojects