请高手把下面的VB代码改编成DELPHI?(300)

  • 主题发起人 主题发起人 jlcsx
  • 开始时间 开始时间
J

jlcsx

Unregistered / Unconfirmed
GUEST, unregistred user!
函数申明部分: Attribute VB_Name = "HMS_57" Declare Function PortOpen_Temic Lib "T5557.DLL" (ByVal port As Integer, ByVal baud As Long) As Long Declare Function PortClose_Temic Lib "T5557.DLL" (ByVal icdev As Long) As Integer Declare Function Test_Temic Lib "T5557.DLL" () As Integer Declare Function Init_Temic Lib "T5557.DLL" (ByVal port As Integer) As Long Declare Function Beep_Temic Lib "T5557.DLL" (ByVal icdev As Long) As Integer Declare Function PortOpen_IC Lib "T5557.DLL" (ByVal port As Integer) As Long Declare Function PortClose_IC Lib "T5557.DLL" (ByVal icdev As Long) As Integer Declare Function Guest_Card_57 Lib "T5557.DLL" (ByVal icdev As Long, ByVal RD_Add As Integer, ByRef Authorization_Code As Byte, ByRef CardID As Byte, ByRef Room1 As Byte, ByRef Room2 As Byte, ByRef Room3 As Byte, ByRef Start_Time As Byte, ByRef End_Time As Byte) As Integer Declare Function Guest_Card_IC Lib "T5557.DLL" (ByVal icdev As Long, ByRef Authorization_Code As Byte, ByRef CardID As Byte, ByRef Room1 As Byte, ByRef Room2 As Byte, ByRef Room3 As Byte, ByRef Start_Time As Byte, ByRef End_Time As Byte) As Integer Declare Function Read_Authorization_Code_57 Lib "T5557.DLL" (ByVal icdev As Long, ByVal RD_Add As Integer, ByRef Authorization_Code As Byte) As Integer Declare Function Read_Authorization_Code_IC Lib "T5557.DLL" (ByVal icdev As Long, ByRef Authorization_Code As Byte) As Integer Declare Function CardData_57 Lib "T5557.DLL" (ByVal icdev As Long, ByVal RD_Add As Integer, ByRef Authorization_Code As Byte, ByRef CardID As Byte, ByRef CardType As Byte) As Integer Declare Function CardData_IC Lib "T5557.DLL" (ByVal icdev As Long, ByRef Authorization_Code As Byte, ByRef CardID As Byte, ByRef CardType As Byte) As Integer Declare Function CardCode Lib "T5557.DLL" (ByRef CARD_CODE As Byte) As Integer Declare Function Clear_Card_57 Lib "T5557.DLL" (ByVal icdev As Long, ByVal RD_Add As Integer) As Integer Declare Function Clear_Card_IC Lib "T5557.DLL" (ByVal icdev As Long) As Integer Global commdev As Long Global OK_Num As Long Global Not_OK_Num As Long Global Totel As Long 其中一按钮事件: Private Sub Command27_Click() Dim st As Long Dim AUTH_CODE(8) As Byte Dim Start_Time(5) As Byte Dim End_Time(5) As Byte Dim RD_Add As Integer Dim Room1(6) As Byte Dim Room2(6) As Byte Dim Room3(6) As Byte Dim CARD_CODE(8) As Byte Dim CardID As Double Dim Temp1 As Double Dim Temp2 As Double RD_Add = Val(Text9.Text) And &HFF st = CardCode(CARD_CODE(0)) Temp1 = CARD_CODE(0) Temp2 = &H1000000 CardID = Temp1 * Temp2 Temp1 = CARD_CODE(1) Temp2 = &H10000 CardID = CardID + Temp1 * Temp2 Temp1 = CARD_CODE(2) Temp2 = &H100 CardID = CardID + Temp1 * Temp2 CardID = CardID + CARD_CODE(3) If Len(Text16.Text) < 16 Then Exit Sub AUTH_CODE(0) = Val("&H" & Mid(Text16.Text, 1, 2)) AUTH_CODE(1) = Val("&H" & Mid(Text16.Text, 3, 2)) AUTH_CODE(2) = Val("&H" & Mid(Text16.Text, 5, 2)) AUTH_CODE(3) = Val("&H" & Mid(Text16.Text, 7, 2)) AUTH_CODE(4) = Val("&H" & Mid(Text16.Text, 9, 2)) AUTH_CODE(5) = Val("&H" & Mid(Text16.Text, 11, 2)) AUTH_CODE(6) = Val("&H" & Mid(Text16.Text, 13, 2)) AUTH_CODE(7) = Val("&H" & Mid(Text16.Text, 15, 2)) Start_Time(0) = Right(Year(Now), 2) Start_Time(1) = Month(Now) Start_Time(2) = Day(Now) Start_Time(3) = Hour(Now) Start_Time(4) = Minute(Now) End_Time(0) = Right(Year(Format(Text26.Text, "yyyy-mm-dd hh:mm:ss")), 2) End_Time(1) = Month(Format(Text26.Text, "yyyy-mm-dd hh:mm:ss")) End_Time(2) = Day(Format(Text26.Text, "yyyy-mm-dd hh:mm:ss")) End_Time(3) = Hour(Format(Text26.Text, "yyyy-mm-dd hh:mm:ss")) End_Time(4) = Minute(Format(Text26.Text, "yyyy-mm-dd hh:mm:ss")) If Text18.Text = "" Then MsgBox "请输入楼栋编号(0---15)!" Exit Sub End If Room1(0) = Val(Text18.Text) And &HF If Text19.Text = "" Then MsgBox "请输入朝向编号(0---15)!" Exit Sub End If Room1(1) = Val(Text19.Text) And &HF If Text20.Text = "" Then MsgBox "请输入楼层编号(0---255)!" Exit Sub End If Room1(2) = Val(Text20.Text) And &HFF If Text21.Text = "" Then MsgBox "请输入房号(0---255)!" Exit Sub End If Room1(3) = Val(Text21.Text) And &HFF If Text22.Text = "" Then MsgBox "请输入套间编号(0---15)!" Exit Sub End If Room1(4) = Val(Text22.Text) And &HF If Text23.Text = "" Then MsgBox "请输入公共区编号(0---15)!" Exit Sub End If Room1(5) = Val(Text23.Text) And &HF Room2(0) = Room1(0) Room2(1) = Room1(1) Room2(2) = Room1(2) Room2(3) = Room1(3) Room2(4) = Room1(4) Room2(5) = Room1(5) Room3(0) = Room1(0) Room3(1) = Room1(1) Room3(2) = Room1(2) Room3(3) = Room1(3) Room3(4) = Room1(4) Room3(5) = Room1(5) Select Case Combo2.Text Case "T5557" st = Guest_Card_57(commdev, RD_Add, AUTH_CODE(0), CARD_CODE(0), Room1(0), Room2(0), Room3(0), Start_Time(0), End_Time(0)) Select Case st Case 0 List1.AddItem "宾客卡写成功!" Case 1 List1.AddItem "宾客卡写失败!" Case 2 List1.AddItem "宾客卡写失败!" Case 3 List1.AddItem "宾客卡写失败!" Case 4 List1.AddItem "宾客卡写失败!" Case 5 List1.AddItem "卡片没有格式化!" End Select Case "IC4442" st = Guest_Card_IC(commdev, AUTH_CODE(0), CARD_CODE(0), Room1(0), Room2(0), Room3(0), Start_Time(0), End_Time(0)) Select Case st Case 0 st = dv_beep(commdev, 10) List1.AddItem "宾客卡写成功!" Case 1 List1.AddItem "宾客卡写失败!" Case 2 List1.AddItem "宾客卡写失败!" Case 3 List1.AddItem "宾客卡写失败!" Case 4 List1.AddItem "宾客卡写失败!" Case 5 List1.AddItem "卡片没有格式化!" End Select End Select End Sub 能把它改称delphi的吗?
 
当然能把它改称delphi的。
 
。。。怎么大富翁尽是这种问题?有现成代码翻译一下很难么,都不愿意自己动手动脑
 
这些官方 sdk 应该有 delphi 接口和例子的啊
 
后退
顶部