亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? frmmain.frm

?? VB和USB通訊示例
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
Dim ThisByte As Byte

For Offset = 0 To Bytes - 1
    Call RtlMoveMemory(ByVal VarPtr(ThisByte), ByVal Address + Offset, 1)
    If (ThisByte And &HF0) = 0 Then
        Result$ = Result$ & "0"
    End If
    Result$ = Result$ & Hex$(ThisByte) & " "
Next Offset

GetDataString = Result$
End Function

Private Function GetErrorString _
    (ByVal LastError As Long) _
As String

'Returns the error message for the last error.
'Adapted from Dan Appleman's "Win32 API Puzzle Book"

Dim Bytes As Long
Dim ErrorString As String
ErrorString = String$(129, 0)
Bytes = FormatMessage _
    (FORMAT_MESSAGE_FROM_SYSTEM, _
    0&, _
    LastError, _
    0, _
    ErrorString$, _
    128, _
    0)
    
'Subtract two characters from the message to strip the CR and LF.
If Bytes > 2 Then
    GetErrorString = Left$(ErrorString, Bytes - 2)
End If

End Function

Private Sub cmdContinuous_Click()
'Enables the user to select 1-time or continuous data transfers.

If cmdContinuous.Caption = "Continuous" Then
    'Change the command button to Cancel Continuous
    cmdContinuous.Caption = "Cancel Continuous"
    'Enable the timer to read and write to the device once/second.
    tmrContinuousDataCollect.Enabled = True
    Call ReadAndWriteToDevice
Else
    'Change the command button to Continuous
    cmdContinuous.Caption = "Continuous"
    'Disable the timer that reads and writes to the device once/second.
    tmrContinuousDataCollect.Enabled = False
End If

End Sub

Private Sub cmdOnce_Click()
Call ReadAndWriteToDevice
End Sub
Private Sub DisplayResultOfAPICall(FunctionName As String)

'Display the results of an API call.

Dim ErrorString As String

lstResults.AddItem ""
ErrorString = GetErrorString(Err.LastDllError)
lstResults.AddItem FunctionName
lstResults.AddItem "  Result = " & ErrorString

'Scroll to the bottom of the list box.
lstResults.ListIndex = lstResults.ListCount - 1

End Sub

Private Sub Form_Load()
frmMain.Show
tmrDelay.Enabled = False
Call Startup
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call Shutdown
End Sub

Private Sub GetDeviceCapabilities()

'******************************************************************************
'HidD_GetPreparsedData
'Returns: a pointer to a buffer containing information about the device's capabilities.
'Requires: A handle returned by CreateFile.
'There's no need to access the buffer directly,
'but HidP_GetCaps and other API functions require a pointer to the buffer.
'******************************************************************************

Dim ppData(29) As Byte
Dim ppDataString As Variant

'Preparsed Data is a pointer to a routine-allocated buffer.
Result = HidD_GetPreparsedData _
    (HidDevice, _
    PreparsedData)
Call DisplayResultOfAPICall("HidD_GetPreparsedData")

'Copy the data at PreparsedData into a byte array.

Result = RtlMoveMemory _
    (ppData(0), _
    PreparsedData, _
    30)
Call DisplayResultOfAPICall("RtlMoveMemory")

ppDataString = ppData()
'Convert the data to Unicode.
ppDataString = StrConv(ppDataString, vbUnicode)

'******************************************************************************
'HidP_GetCaps
'Find out the device's capabilities.
'For standard devices such as joysticks, you can find out the specific
'capabilities of the device.
'For a custom device, the software will probably know what the device is capable of,
'so this call only verifies the information.
'Requires: The pointer to a buffer containing the information.
'The pointer is returned by HidD_GetPreparsedData.
'Returns: a Capabilites structure containing the information.
'******************************************************************************
Result = HidP_GetCaps _
    (PreparsedData, _
    Capabilities)

Call DisplayResultOfAPICall("HidP_GetCaps")
lstResults.AddItem "  Last error: " & ErrorString
lstResults.AddItem "  Usage: " & Hex$(Capabilities.Usage)
lstResults.AddItem "  Usage Page: " & Hex$(Capabilities.UsagePage)
lstResults.AddItem "  Input Report Byte Length: " & Capabilities.InputReportByteLength
lstResults.AddItem "  Output Report Byte Length: " & Capabilities.OutputReportByteLength
lstResults.AddItem "  Feature Report Byte Length: " & Capabilities.FeatureReportByteLength
lstResults.AddItem "  Number of Link Collection Nodes: " & Capabilities.NumberLinkCollectionNodes
lstResults.AddItem "  Number of Input Button Caps: " & Capabilities.NumberInputButtonCaps
lstResults.AddItem "  Number of Input Value Caps: " & Capabilities.NumberInputValueCaps
lstResults.AddItem "  Number of Input Data Indices: " & Capabilities.NumberInputDataIndices
lstResults.AddItem "  Number of Output Button Caps: " & Capabilities.NumberOutputButtonCaps
lstResults.AddItem "  Number of Output Value Caps: " & Capabilities.NumberOutputValueCaps
lstResults.AddItem "  Number of Output Data Indices: " & Capabilities.NumberOutputDataIndices
lstResults.AddItem "  Number of Feature Button Caps: " & Capabilities.NumberFeatureButtonCaps
lstResults.AddItem "  Number of Feature Value Caps: " & Capabilities.NumberFeatureValueCaps
lstResults.AddItem "  Number of Feature Data Indices: " & Capabilities.NumberFeatureDataIndices

'******************************************************************************
'HidP_GetValueCaps
'Returns a buffer containing an array of HidP_ValueCaps structures.
'Each structure defines the capabilities of one value.
'This application doesn't use this data.
'******************************************************************************

'This is a guess. The byte array holds the structures.
Dim ValueCaps(1023) As Byte

Result = HidP_GetValueCaps _
    (HidP_Input, _
    ValueCaps(0), _
    Capabilities.NumberInputValueCaps, _
    PreparsedData)
   
Call DisplayResultOfAPICall("HidP_GetValueCaps")

'lstResults.AddItem "ValueCaps= " & GetDataString((VarPtr(ValueCaps(0))), 180)
'To use this data, copy the byte array into an array of structures.

End Sub

Private Sub InitializeDisplay()
Dim Count As Integer
Dim ByteValue As String
'Create a dropdown list box for each byte to send.
For Count = 0 To 255
    If Len(Hex$(Count)) < 2 Then
        ByteValue = "0" & Hex$(Count)
    Else
        ByteValue = Hex$(Count)
    End If
    frmMain.cboByte0.AddItem ByteValue, Count
Next Count
For Count = 0 To 255
    If Len(Hex$(Count)) < 2 Then
        ByteValue = "0" & Hex$(Count)
    Else
        ByteValue = Hex$(Count)
    End If
    frmMain.cboByte1.AddItem ByteValue, Count
Next Count
'Select a default item for each box
frmMain.cboByte0.ListIndex = 0
frmMain.cboByte1.ListIndex = 128
End Sub

Private Sub ReadAndWriteToDevice()
'Sends two bytes to the device and reads two bytes back.

Dim DeviceDetected As Boolean

'Report Header
lstResults.AddItem "HID Test Report"
lstResults.AddItem Format(Now, "general date")

'Some data to send
'(if not using the combo boxes):
'OutputReportData(0) = &H12
'OutputReportData(1) = &H34
'OutputReportData(2) = &HF0
'OutputReportData(3) = &HF1
'OutputReportData(4) = &HF2
'OutputReportData(5) = &HF3
'OutputReportData(6) = &HF4
'OutputReportData(7) = &HF5

'Get the bytes to send from the combo boxes.
'Increment the values if the autoincrement check box is selected.
If chkAutoincrement.Value = 1 Then
    If cboByte0.ListIndex < 255 Then
        cboByte0.ListIndex = cboByte0.ListIndex + 1
    Else
        cboByte0.ListIndex = 0
    End If
    If cboByte1.ListIndex < 255 Then
        cboByte1.ListIndex = cboByte1.ListIndex + 1
    Else
        cboByte1.ListIndex = 0
    End If
End If

OutputReportData(0) = cboByte0.ListIndex
OutputReportData(1) = cboByte1.ListIndex

'Find the device
DeviceDetected = FindTheHid
If DeviceDetected = True Then
    'Learn the capabilities of the device
    Call GetDeviceCapabilities
    'Write a report to the device
    Call WriteReport
    
    'The firmware adds 1 to each received byte and sends the bytes back
    'to the host.
    'Add a delay to allow the host time to poll for the returned data.
    Timeout = False
    tmrDelay.Interval = 100
    tmrDelay.Enabled = True
    Do
        DoEvents
    Loop Until Timeout = True
    'Read a report from the device.
    Call ReadReport
Else
End If

'Scroll to the bottom of the list box.
lstResults.ListIndex = lstResults.ListCount - 1

End Sub

Private Sub ReadReport()

'Read data from the device.

Dim Count
Dim NumberOfBytesRead As Long
'Allocate a buffer for the report.
'Byte 0 is the report ID.
Dim ReadBuffer() As Byte
Dim UBoundReadBuffer As Integer

'******************************************************************************
'ReadFile
'Returns: the report in ReadBuffer.
'Requires: a device handle returned by CreateFile,
'the Input report length in bytes returned by HidP_GetCaps.
'******************************************************************************

'ReadFile is a blocking call. The application will hang until the device
'sends the requested amount of data. To prevent hanging, be sure that
'the device always has data to send.

Dim ByteValue As String
'The ReadBuffer array begins at 0, so subtract 1 from the number of bytes.
ReDim ReadBuffer(Capabilities.InputReportByteLength - 1)
    
'Pass the address of the first byte of the read buffer.
Result = ReadFile _
    (HidDevice, _
    ReadBuffer(0), _
    CLng(Capabilities.InputReportByteLength), _
    NumberOfBytesRead, _
    0)
Call DisplayResultOfAPICall("ReadFile")

lstResults.AddItem " Report ID: " & ReadBuffer(0)
lstResults.AddItem " Report Data:"

txtBytesReceived.Text = ""
For Count = 1 To UBound(ReadBuffer)
    'Add a leading 0 to values 0 - Fh.
    If Len(Hex$(ReadBuffer(Count))) < 2 Then
        ByteValue = "0" & Hex$(ReadBuffer(Count))
    Else
        ByteValue = Hex$(ReadBuffer(Count))
    End If
    lstResults.AddItem " " & ByteValue
    'Display the received bytes in the text box.
    txtBytesReceived.SelStart = Len(txtBytesReceived.Text)
    txtBytesReceived.SelText = ByteValue & vbCrLf
    
Next Count
End Sub

Private Sub Shutdown()
'Includes actions that must execute when the program ends.

'Close the open handle to the device.
Result = CloseHandle _
    (HidDevice)
Call DisplayResultOfAPICall("CloseHandle (HidDevice)")

'Free memory used by SetupDiGetClassDevs
'Nonzero = success
Result = SetupDiDestroyDeviceInfoList _
    (DeviceInfoSet)
Call DisplayResultOfAPICall("DestroyDeviceInfoList")

Result = HidD_FreePreparsedData _
    (PreparsedData)
Call DisplayResultOfAPICall("HidD_FreePreparsedData")

End Sub

Private Sub Startup()
Call InitializeDisplay
tmrContinuousDataCollect.Enabled = False
tmrContinuousDataCollect.Interval = 1000
End Sub

Private Sub tmrContinuousDataCollect_Timer()
Call ReadAndWriteToDevice

End Sub

Private Sub tmrDelay_Timer()
Timeout = True
tmrDelay.Enabled = False
End Sub

Private Sub WriteReport()
'Send data to the device.

Dim Count As Integer
Dim NumberOfBytesRead As Long
Dim NumberOfBytesToSend As Long
Dim NumberOfBytesWritten As Long
Dim ReadBuffer() As Byte
Dim SendBuffer() As Byte

'The SendBuffer array begins at 0, so subtract 1 from the number of bytes.
ReDim SendBuffer(Capabilities.OutputReportByteLength - 1)

'******************************************************************************
'WriteFile
'Sends a report to the device.
'Returns: success or failure.
'Requires: the handle returned by CreateFile and
'The output report byte length returned by HidP_GetCaps
'******************************************************************************

'The first byte is the Report ID
SendBuffer(0) = 0

'The next bytes are data
For Count = 1 To Capabilities.OutputReportByteLength - 1
    SendBuffer(Count) = OutputReportData(Count - 1)
Next Count

NumberOfBytesWritten = 0

Result = WriteFile _
    (HidDevice, _
    SendBuffer(0), _
    CLng(Capabilities.OutputReportByteLength), _
    NumberOfBytesWritten, _
    0)
Call DisplayResultOfAPICall("WriteFile")

lstResults.AddItem " OutputReportByteLength = " & Capabilities.OutputReportByteLength
lstResults.AddItem " NumberOfBytesWritten = " & NumberOfBytesWritten
lstResults.AddItem " Report ID: " & SendBuffer(0)
lstResults.AddItem " Report Data:"

For Count = 1 To UBound(SendBuffer)
    lstResults.AddItem " " & Hex$(SendBuffer(Count))
Next Count

End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区影音先锋| 欧美成人aa大片| 91精品国产欧美一区二区成人 | 国产精品久久久久婷婷二区次| 专区另类欧美日韩| 日韩不卡一区二区三区| 国产精品综合视频| 欧洲一区二区三区在线| 久久综合九色综合97婷婷| 亚洲欧美日韩国产手机在线| 久久精品久久精品| 色综合天天综合网天天狠天天| 日韩一区二区中文字幕| 亚洲丝袜美腿综合| 久久国产精品72免费观看| 不卡的av网站| 欧美成人在线直播| 亚洲激情图片qvod| 国产成人h网站| 欧美日韩大陆在线| 国产精品乱人伦中文| 午夜精品久久久久久| 夫妻av一区二区| 欧美一级理论片| 一区二区三区欧美日| 国产二区国产一区在线观看| 欧美日韩一级视频| 亚洲欧洲日韩在线| 精品影视av免费| 欧美在线你懂得| 国产精品视频线看| 看国产成人h片视频| 在线视频综合导航| 国产精品久久夜| 久国产精品韩国三级视频| 欧美综合欧美视频| 中文字幕一区二区三区在线观看| 久久精品二区亚洲w码| 欧美日韩一区二区三区四区| 国产精品亲子伦对白| 国产尤物一区二区在线| 91精品国产综合久久久久久漫画| 亚洲精品第一国产综合野| 国产成人在线视频网址| 精品免费一区二区三区| 亚洲成a人片在线观看中文| 色综合中文综合网| 在线成人av网站| 亚洲一二三区不卡| av一区二区久久| 欧美激情艳妇裸体舞| 国产一区二区三区四区五区入口| 91精品久久久久久久久99蜜臂| 亚洲国产aⅴ天堂久久| 色欧美片视频在线观看在线视频| 中文在线资源观看网站视频免费不卡 | 成人v精品蜜桃久久一区| 精品国产99国产精品| 免费日韩伦理电影| 欧美一级国产精品| 蜜臀国产一区二区三区在线播放| 欧美在线色视频| 亚洲一区二区三区小说| 色8久久人人97超碰香蕉987| 自拍偷拍亚洲欧美日韩| 97se亚洲国产综合在线| 亚洲私人影院在线观看| 色综合久久中文综合久久97| 亚洲图片激情小说| 91麻豆免费在线观看| 亚洲色图制服丝袜| 91视频在线观看| 亚洲欧美日韩在线| 在线亚洲免费视频| 亚洲高清免费观看 | 免费成人在线影院| 欧美va亚洲va| 国产精品18久久久| 中文字幕日韩一区| 97久久超碰国产精品电影| 亚洲精品美腿丝袜| 欧美日韩一区二区不卡| 日韩和欧美一区二区三区| 日韩欧美视频在线| 国产露脸91国语对白| 久久久久久亚洲综合影院红桃| 国产精品一二三区| 日韩毛片视频在线看| 欧美综合视频在线观看| 男男视频亚洲欧美| 国产亚洲午夜高清国产拍精品 | 亚洲欧美区自拍先锋| 欧美色图第一页| 免费三级欧美电影| 久久久www免费人成精品| 成人av在线资源网| 一区二区三区四区精品在线视频 | 蜜臀av一区二区在线免费观看 | 不卡视频在线观看| 亚洲综合久久久久| 欧美成人一区二区三区在线观看| 国产成人精品一区二区三区四区 | 欧美日韩色一区| 久久成人久久爱| 国产精品成人一区二区艾草 | 亚洲成人免费观看| 久久综合网色—综合色88| 成人性生交大片免费| 亚洲国产日韩一级| 久久久久久久久久久黄色| 一本色道久久综合狠狠躁的推荐| 日本亚洲视频在线| 国产精品私人自拍| 欧美电影一区二区三区| 国产不卡视频在线播放| 一区二区三区美女| 欧美v日韩v国产v| 色综合久久久久久久久| 九色porny丨国产精品| 成人欧美一区二区三区| 欧美一区二区视频在线观看2020| 成人一区二区三区视频在线观看| 亚洲一区在线观看免费观看电影高清| 久久一日本道色综合| 在线观看亚洲a| 国产精品一卡二卡| 日韩影院免费视频| 中文字幕中文在线不卡住| 日韩一二三四区| 91麻豆高清视频| 久久成人18免费观看| 亚洲与欧洲av电影| 国产精品毛片久久久久久久| 91精品国产91综合久久蜜臀| 91在线精品一区二区| 狠狠色丁香九九婷婷综合五月| 一区二区三区在线观看网站| 久久九九全国免费| 日韩一区二区三区四区| 日本乱人伦一区| 成人综合在线网站| 欧美aⅴ一区二区三区视频| 一区二区三区高清| 国产欧美日产一区| 精品国内二区三区| 欧美片网站yy| 在线亚洲一区观看| 成人黄色一级视频| 国产曰批免费观看久久久| 人人爽香蕉精品| 香蕉成人伊视频在线观看| 亚洲免费在线视频一区 二区| 久久久久国产精品人| 日韩欧美黄色影院| 51精品视频一区二区三区| 91免费观看视频| 成人综合在线观看| 国产福利不卡视频| 国模娜娜一区二区三区| 免费久久精品视频| 日韩一区欧美二区| 亚洲成av人片| 亚洲丶国产丶欧美一区二区三区| 亚洲视频一区二区在线观看| 欧美国产丝袜视频| 久久久久久久久久久久久夜| 欧美成人r级一区二区三区| 日韩午夜精品电影| 欧美精品日韩一区| 欧美日本在线观看| 欧美日韩在线直播| 欧美三级欧美一级| 欧美性感一类影片在线播放| 一本色道久久综合亚洲aⅴ蜜桃| 不卡av在线网| 色综合视频一区二区三区高清| 成人免费高清视频| 99久久综合99久久综合网站| 成人免费视频一区| 成人黄色在线看| 91尤物视频在线观看| 不卡在线视频中文字幕| 成人app软件下载大全免费| 成人av电影在线| 色综合久久综合中文综合网| 色婷婷亚洲综合| 欧美日韩中文一区| 欧美年轻男男videosbes| 7777精品伊人久久久大香线蕉的 | 日韩和欧美的一区| 毛片基地黄久久久久久天堂| 麻豆高清免费国产一区| 国产一区二区不卡| 国产馆精品极品| 99国产精品国产精品久久| 色哟哟国产精品| 7777精品伊人久久久大香线蕉最新版| 欧美一区在线视频| 久久久久国产精品厨房| 国产精品黄色在线观看|