動態庫函式說明:
Function “GetBellTime”
[Function] Function “GetBellTime” is used to get the bell time from the terminal.
[Format] BOOL GetBellTime ( Long dwMachineNumber,
Long * dwValue,
Long * dwBellInfo );
[Parameter] dwMachineNumber : ID number of the terminal to delete the registration data from.
dwValue : A long-type pointer to the value of the bell count.
Minimum 1 : Maximun : 8
dwBellInfo : A long-type pointer to the value of the bell time information.
The data is 24 bytes in size.
[Return Value] It is TRUE when a valid data has been read from the terminal.
It would be FALSE if the terminal does not have the specified data on it or an error has
occurred to the communication. When the return value is FALSE, the values of parameters
have no meanings.
//vb demo
Const DataLen = 24
Dim mlngBellInfo(DataLen / 4 - 1) As Long
Dim vErrorCode As Long
lblMessage.Caption = "Waiting..."
DoEvents
If frmMain.Fk528KM1.EnableDevice(mMachineNumber, False) = False Then
lblMessage.Caption = gstrNoDevice
Exit Sub
End If
vRet = frmMain.Fk528KM1.GetBellTime(mMachineNumber, mBellCount, mlngBellInfo(0))
If vRet = True Then
CopyMemory mBellInfo, mlngBellInfo(0), DataLen
ShowValue
lblMessage.Caption = "Success!"
Else
frmMain.Fk528KM1.GetLastError vErrorCode
lblMessage.Caption = ErrorPrint(vErrorCode)
End If
////
Long * dwBellInfo 這個引數該怎么設 ? 我用long ,long [] 都不行
請高手指點下!
uj5u.com熱心網友回復:
如果是輸入引數就是long,如果是輸出引數就是ref longuj5u.com熱心網友回復:
帶 ref 啦的uj5u.com熱心網友回復:
dwBellInfo 這個引數好像在使用的時候要有開辟一塊存盤空間的意思(我感覺)uj5u.com熱心網友回復:
我還是帖上pb代碼 LongLong ll_bellInfo[5] 我試過 long integer 直接陣列//獲取設備 定時鈴
CONSTANT INTEGER DataLen = 24
Integer li_rt
Long ll_bellTimes
LongLong ll_bellInfo[5]
st_belltime Lst_belltime
If zdm.Object.GetBellTime(Integer(ist_mcInfo.macNo),Ref ll_bellTimes,Ref ll_bellInfo[1]) Then
CopyMemory(Ref Lst_belltime, ll_bellInfo[1],DataLen)
li_rt = 1
f_mainshowmess(ist_mcInfo.MacNo + '號機器獲取電鈴時間成功!' )
Else
li_rt = -1
f_mainshowmess(ist_mcInfo.MacNo + '號機器獲取電鈴時間失敗:' + of_GetLastError())
End If
Return li_rt
uj5u.com熱心網友回復:
試試這樣:CONSTANT INTEGER DataLen = 24
Integer li_rt
Long ll_bellTimes
LongLong ll_bellInfo
st_belltime Lst_belltime
ll_bellInfo = 0
If zdm.Object.GetBellTime(Integer(ist_mcInfo.macNo),Ref ll_bellTimes,Ref ll_bellInfo) Then
CopyMemory(Ref Lst_belltime, ll_bellInfo,DataLen)
li_rt = 1
f_mainshowmess(ist_mcInfo.MacNo + '號機器獲取電鈴時間成功!' )
Else
li_rt = -1
f_mainshowmess(ist_mcInfo.MacNo + '號機器獲取電鈴時間失敗:' + of_GetLastError())
End If
Return li_rt
uj5u.com熱心網友回復:
這樣子 和直接 用ref long 一樣回傳是 True 可是 下面 CopyMemory 沒有資料 ll_bellTimes 也是0 這個我在vb跟蹤了 ll_bellTimes 是有值的
謝謝你
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/79262.html
標籤:API 調用
上一篇:購飛鴿傳書pb版例子
