Platform Builder: Fmerge Tips and Tricks
来源:互联网 发布:tm域名 编辑:程序博客网 时间:2024/05/29 07:15
1. The most basic conditional expression is the IF <environmentvariable> statement that you may see in many of the sample BSPs. The syntax is:
IF <EnvironmentVariable> [!]
… some settings…
ENDIF
Where EnvironmentVariable is a an environment variable set on your development system and the ‘!’ is the not character. This conditional allows you to check to see if an environment variable is defined, or not defined.This explains why setting an environment variable equal to zero (0) is not the same thing as clearing the variable. If you set the variable to zero, it is still defined. If you clear the variable, it is no longer defined and can be checked by this conditional. So:
Set BSP_MYVAR=
Is not the same as
Set BSP_MYVAR=0
Example:
IF BSP_DRIVERSUPPORT
IF BSP_MYDRIVER
[HKEY_LOCAL_MACHINE/Drivers/Builtin/MyDriver]
“dll”=”MyDriver.dll”
“Index”=dword:1
ENDIF
ENDIF
Which includes the registry settings for MyDriver when BSP_DRIVERSUPPORT and BSP_MYDRIVER are defined.
2. Fmerge was enhanced in Windows CE 4.0 to support new conditional expressions which are much more powerful. The enhanced conditional expressions add support for value comparison and else statements. The new syntax is:
#if ExpressionList
#elif ExpressionList#else
#endif
Where ExpressionList can include “==”, “!=”, “||” and “&&” operators. So now we can simplify the previous example:
#if defined BSP_DRIVERSUPPORT && defined BSP_MYDRIVER
[HKEY_LOCAL_MACHINE/Drivers/Builtin/MyDriver]
“dll”=”MyDriver.dll”
“Index”=dword:1
#endif
Note the use of defined to check to see if a variable is defined.
This conditional also allows us to check for a value of variable, which allows us to do things like only include a registry setting if we are building a debug build of the OS:
#if “$(WINCEDEBUG)”==”debug”
[HKEY_LOCAL_MACHINE/Drivers/Builtin/MyDriver]
“dll”=”MyDriver.dll”
“Index”=dword:1
#endif
- Platform Builder: Fmerge Tips and Tricks
- Printing Tips and Tricks
- Win32 Tips and Tricks
- Printing Tips and Tricks
- Win32 Tips and Tricks
- Matlab: Tips and tricks
- Sed Tips and Tricks
- Eclipse Tips and Tricks
- Ruby tricks and tips
- Rspec tips and tricks
- C++ Tips and Tricks
- Pentest Tips and Tricks
- Visual C++ Tips and Tricks
- Android Build: Tips and Tricks
- Visual C++ Tips and Tricks
- Vi/Vim Tips and Tricks
- Android Build: Tips and Tricks
- JavaScript tips and tricks - 1
- DbUnit入门实战
- 12.00 积分快没了
- ce6下无明显针对MFC的组件,M$已经准备放弃MFC了
- 一个资深主管的10条职场感悟(转载)
- LCD Driver 筆記 - Frame Buffer
- Platform Builder: Fmerge Tips and Tricks
- 嵌入式2D加速显卡SM501驱动的移植[linux.2.6.18]
- Windows自启动程序十大藏身之所
- 20080407股票投资
- 比较: forward与rederect
- 自动上传本地图片和word图片(word图片需使用从word粘贴功能)
- 资源分问题
- TCP/IP协议在Linux2.4上的实现 之 网卡驱动篇
- 酷源KYCMS内容网站管理系统