Using CEConfig.h

来源:互联网 发布:linux usb声卡驱动 编辑:程序博客网 时间:2024/06/11 19:42

原文地址

 

Every Windows CE device has a filenamed CEConfig.h in the /Windows folder. This file can be used toconditionally compile code against different projects or SDKs. It canalso be used to determine the license level of a Windows CE OS.
CEConfig.h is created when a WindowsCE OS project is built, or more specifically sysgened, using PlatformBuilder. CEConfig.h contains macro definitions for the OS componentsincluded in the project. In other words, it can tell the C code aboutthe features that will be available at runtime.
For example, some Windows CE OS’sinclude ToolHelpAPI, which is a collection of functions that can beused to gather information at runtime. But ToolHelpAPI is optional andif you write your application to depend on it, your application willfail at runtime. If the OS includes ToolHelpAPI, then CEConfig.h willcontain:
#define CE_MODULES_TOOLHELP 1
So your code can check for this:
#include <ceconfig.h>
 
#ifdef CE_MODULES_TOOLHELP
#include "tlhelp32.h"
#endif
CEConfig.h can also be used todetermine the license level of the OS. Microsoft provides a LicenseTool that reads CEConfig.h and outputs the license level of the OS. This tool can be downloaded from Microsoft® Windows® CE 5.0 Run-time Assessment Tool for Windows CE 5.0 and for Windows CE 6.0 it is installed in Visual Studio’s Tools menu when you install Platform Builder.
原创粉丝点击