vb语句片段转为delphi 5C

请大侠
帮我将下面语句转为delphi 感激不尽!
function MB(hWnd: HWND; lpText, lpCaption: PChar; uType: UINT): Integer;
stdcall; external user32 name 'MessageBoxA

Private Sub Command1_Click()

Dim C(1 To 5) As Byte

C(1) = &H1B
C(2) = &H70
If Check1.Value = 0 Then
    C(3) = &H0
Else
    C(3) = &H1
End If
C(4) = &H3C
C(5) = &HFF

Dim Hdl As Long
Dim flag As Long

'USB通信
Hdl = POS_Open(Combo1.Text, 0, 0, 0, 0, POS_OPEN_PRINTNAME) '打开驱动程序

If Hdl = -1 Then

    MsgBox "USB handle error,please try again!"
    Exit Sub

End If

flag = POS_StartDoc()
flag = POS_WriteFile(Hdl, VarPtr(C(LBound(C))), UBound(C) - LBound(C) + 1)
flag = POS_EndDoc()

flag = POS_Close

End Sub

1个回答

关键看你 POS_Open 、 POS_StartDoc 等函数在哪里定义的。主要的功能都封装在这些函数里。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!