'*******************************************************************
'*******************************************************************
'<函數:Decode>
'作用:將16進制數據編碼轉化為字符串,是Encode的逆過程
Public Function Decode(strDecode As String) As String
Dim i As Long
Dim strCode$ '存儲轉換後的編碼
Dim chrTmp$
On Error GoTo ErrProc
If Len(strDecode) Mod 4 <> 0 Then GoTo ErrProc
For i = 1 To Len(strDecode) Step 4
strCode = Mid$(strDecode, i, 4)
chrTmp$ = ChrW("&H" & strCode)
If chrTmp$ = "?" Then If strCode <> "003F" Then GoTo ErrProc
Decode = Decode & chrTmp$
Next
Exit Function
ErrProc:
Decode = strDecode
DealwithEvents "不能解析的消息:" & strDecode
End Function
'</函數:Decode>
'*******************************************************************