首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

嵌入开发(WinCE)的一些经验 012

嵌入开发(WinCE)的一些经验 012

Palm OS ROM
http://www.echoice.com.cn/download/download.asp?softwareID=132

Release configurations use the following macros:
RETAILMSG(cond, printf_exp). Conditionally displays the print message.
RETAILLED(cond, parms). Conditionally outputs WORD values to the LED.
ERRORMSG(cond, printf_exp). Prints "Error: File Line" before the print message.

To enable the debug macros, you must build a debug configuration. Debug configurations use the three retail macros listed above, as well as the following debug macros:
DEBUGMSG(cond, printf_exp). Conditionally displays the print message.
DEBUGLED(cond, parms). Conditionally outputs WORD values to the LED.
DEBUGCHK(expr). Asserts the expression. If expr is FALSE, the macro calls DEBUGBREAK.
DEBUGZONE(zone_id). Tests the mask bit in the current debug zone settings. You can use DEBUGZONE to turn debug zones on or off.

Declare Function TranslateMessage Lib "coredll.dll" (ByVal MSG As String) As Boolean
网上down到的,有关unicode的函数集:

Attribute VB_Name = "modUniCode"
Option Explicit
Public Function MemStringToLong(StringIn As String) As Long
  On Error Resume Next
  Dim hWorkVal As String
  " Convert the String back to Long Integer.
  " Converting back to Big Endian format.
  Dim i As Long
  For i = 4 To 1 Step -1
  hWorkVal = hWorkVal & Hex(AscB(MidB(StringIn, i, 1)))
  Next i
  " Return Long Integer value.
  MemStringToLong = CLng("&H" & hWorkVal)
End Function
Public Function LongToMemoryString(ByVal lInputValue As Long) As String
Dim hWorkVal As String
Dim n As Long
Dim i As Long
" Convert to HEX value.
hWorkVal = Hex(lInputValue)
" Check to see if it is not zero.
If hWorkVal <> "0" Then
  " Convert to memory storage format (Little Endian).
  " For example, 0000A411 would convert to 11A40000.
  "
  " Place leading zeros in 8 character sequence to
  " maintain consistent character count
  n = Len(hWorkVal)
  If n < 8 Then
    hWorkVal = String(8 - n, "0") & hWorkVal
  End If
  "
  " Use ChrB to rebuild Bytes.
  For i = 7 To 1 Step -2
    LongToMemoryString = LongToMemoryString & _
              ChrB(CInt("&H" & Mid(hWorkVal, i, 2)))
  Next i


Else
  " Just return zeros.
  " Use ChrB to build Bytes.
  LongToMemoryString = ChrB(CInt("&H00"))
  LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
  LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
  LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
End If
End Function
返回列表