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

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

?? hidmodule.bas

?? 非常好的的USB 接口程序 基于pic單片機
?? BAS
?? 第 1 頁 / 共 2 頁
字號:
        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 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 _
        (HIDHandle, _
        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")
    '"  Last error: " & ErrorString
    '"  Usage: " & Hex$(Capabilities.Usage)
    '"  Usage Page: " & Hex$(Capabilities.UsagePage)
    '"  Input Report Byte Length: " & Capabilities.InputReportByteLength
    '"  Output Report Byte Length: " & Capabilities.OutputReportByteLength
    '"  Feature Report Byte Length: " & Capabilities.FeatureReportByteLength
    '"  Number of Link Collection Nodes: " & Capabilities.NumberLinkCollectionNodes
    '"  Number of Input Button Caps: " & Capabilities.NumberInputButtonCaps
    '"  Number of Input Value Caps: " & Capabilities.NumberInputValueCaps
    '"  Number of Input Data Indices: " & Capabilities.NumberInputDataIndices
    '"  Number of Output Button Caps: " & Capabilities.NumberOutputButtonCaps
    '"  Number of Output Value Caps: " & Capabilities.NumberOutputValueCaps
    '"  Number of Output Data Indices: " & Capabilities.NumberOutputDataIndices
    '"  Number of Feature Button Caps: " & Capabilities.NumberFeatureButtonCaps
    '"  Number of Feature Value Caps: " & Capabilities.NumberFeatureValueCaps
    '"  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.
    
    'Free the buffer reserved by HidD_GetPreparsedData
    
    Result = HidD_FreePreparsedData _
        (PreparsedData)
    Call DisplayResultOfAPICall("HidD_FreePreparsedData")
End Sub

Private Sub PrepareForOverlappedTransfer()
    '******************************************************************************
    'CreateEvent
    'Creates an event object for the overlapped structure used with ReadFile.
    'Requires a security attributes structure or null,
    'Manual Reset = True (ResetEvent resets the manual reset object to nonsignaled),
    'Initial state = True (signaled),
    'and event object name (optional)
    'Returns a handle to the event object.
    '******************************************************************************
    
    If EventObject = 0 Then
        EventObject = CreateEvent _
            (Security, _
            True, _
            True, _
            "")
    End If
        
    Call DisplayResultOfAPICall("CreateEvent")
        
    'Set the members of the overlapped structure.
    
    HIDOverlapped.Offset = 0
    HIDOverlapped.OffsetHigh = 0
    HIDOverlapped.hEvent = EventObject
End Sub

Private Sub DisplayResultOfAPICall(FunctionName As String)
    'Display the results of an API call.
    
    Dim ErrorString As String
    
    ErrorString = GetErrorString(Err.LastDllError)
    'FunctionName Result = ErrorString
End Sub

Public Sub ReadAndWriteToDevice()
    'Sends two bytes to the device and reads two bytes back.
    
    Dim Count As Integer
    'If the device hasn't been detected or it timed out on a previous attempt
    'to access it, look for the device.
    
    If MyDeviceDetected = False Then
        MyDeviceDetected = FindTheHid
    End If
    
    If MyDeviceDetected = True Then
        'Write a report to the device
        Call WriteReport
        
        'Read a report from the device.
        Call ReadReport
    Else
    End If
End Sub

Public 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.
    
    '******************************************************************************
    'ReadFile
    'Returns: the report in ReadBuffer.
    'Requires: a device handle returned by CreateFile
    '(for overlapped I/O, CreateFile must be called with FILE_FLAG_OVERLAPPED),
    'the Input report length in bytes returned by HidP_GetCaps,
    'and an overlapped structure whose hEvent member is set to an event object.
    '******************************************************************************
    
    Dim ByteValue As String
    
    'The ReadBuffer array begins at 0, so subtract 1 from the number of bytes.
    
    ReDim ReadBuffer(Capabilities.InputReportByteLength - 1)
    
    'Do an overlapped ReadFile.
    'The function returns immediately, even if the data hasn't been received yet.
    
    Result = ReadFile _
        (ReadHandle, _
        ReadBuffer(0), _
        CLng(Capabilities.InputReportByteLength), _
        NumberOfBytesRead, _
        HIDOverlapped)
    Call DisplayResultOfAPICall("ReadFile")
    
   'Waiting for ReadFile

    bAlertable = True
    
    '******************************************************************************
    'WaitForSingleObject
    'Used with overlapped ReadFile.
    'Returns when ReadFile has received the requested amount of data or on timeout.
    'Requires an event object created with CreateEvent
    'and a timeout value in milliseconds.
    '******************************************************************************
    Result = WaitForSingleObject _
        (EventObject, _
        6000)
    Call DisplayResultOfAPICall("WaitForSingleObject")
    
    'Find out if ReadFile completed or timeout.
    
    Select Case Result
        Case WAIT_OBJECT_0
            'ReadFile has completed
        Case WAIT_TIMEOUT
            'Timeout
            
            'Cancel the operation
            
            '*************************************************************
            'CancelIo
            'Cancels the ReadFile
            'Requires the device handle.
            'Returns non-zero on success.
            '*************************************************************
            Result = CancelIo _
                (ReadHandle)
            Call DisplayResultOfAPICall("CancelIo")
            
            'The timeout may have been because the device was removed,
            'so close any open handles and
            'set MyDeviceDetected=False to cause the application to
            'look for the device on the next attempt.
            
            CloseHandle (HIDHandle)
            Call DisplayResultOfAPICall("CloseHandle (HIDHandle)")
            CloseHandle (ReadHandle)
            Call DisplayResultOfAPICall("CloseHandle (ReadHandle)")
            MyDeviceDetected = False
        Case Else
            'Readfile undefined error
            MyDeviceDetected = False
    End Select
        
    'Report ID = ReadBuffer(0)
    'Report Data = ReadBuffer(Count)
    
    '******************************************************************************
    'ResetEvent
    'Sets the event object in the overlapped structure to non-signaled.
    'Requires a handle to the event object.
    'Returns non-zero on success.
    '******************************************************************************
    
    Call ResetEvent(EventObject)
    Call DisplayResultOfAPICall("ResetEvent")
End Sub

Public Sub WriteReport()
    'Send data to the device.
    
    Dim Count As Integer
    Dim NumberOfBytesWritten As Long
    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 _
        (HIDHandle, _
        SendBuffer(0), _
        CLng(Capabilities.OutputReportByteLength), _
        NumberOfBytesWritten, _
        0)
    Call DisplayResultOfAPICall("WriteFile")
    
    'OutputReportByteLength = Capabilities.OutputReportByteLength
    'NumberOfBytesWritten = NumberOfBytesWritten
    'Report ID = SendBuffer(0)
    'Report Data = SendBuffer(Count)
End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品黄色片免费大全| 欧美天堂一区二区三区| 日韩亚洲欧美中文三级| 日本最新不卡在线| 日韩一区二区三区免费观看| 午夜精品久久久久久久蜜桃app| 欧美亚洲国产bt| 日本在线播放一区二区三区| 日韩欧美久久久| 国产99一区视频免费| 日韩理论片在线| 欧美日韩国产在线观看| 毛片不卡一区二区| 中文字幕国产一区| 在线观看国产日韩| 麻豆国产欧美一区二区三区| 国产视频一区二区在线| 91丨九色丨国产丨porny| 午夜a成v人精品| 26uuu欧美日本| 91在线国内视频| 水野朝阳av一区二区三区| 欧美精品一区二区三区蜜桃| heyzo一本久久综合| 婷婷久久综合九色国产成人 | 天堂蜜桃一区二区三区| 日韩三级视频在线观看| 国产成人鲁色资源国产91色综| 亚洲免费三区一区二区| 欧美一级高清片| 91婷婷韩国欧美一区二区| 蜜桃av一区二区三区电影| 国产精品久久久久影院亚瑟| 5858s免费视频成人| 成人av先锋影音| 天天免费综合色| 成人欧美一区二区三区白人| 欧美成人vps| 91久久精品午夜一区二区| 极品少妇xxxx精品少妇偷拍| 亚洲一区二区欧美日韩| 国产精品午夜久久| 日韩欧美成人一区| 91免费看`日韩一区二区| 国产在线乱码一区二区三区| 亚洲一区二区三区视频在线| 久久久不卡影院| 欧美一级二级在线观看| 欧美网站一区二区| 欧美优质美女网站| 亚洲天天做日日做天天谢日日欢| 日本高清不卡视频| 91网站最新地址| 亚洲欧美色综合| 在线免费观看日韩欧美| 免费人成在线不卡| 欧美日韩免费观看一区三区| 亚洲精品自拍动漫在线| 欧美日韩国产一级片| 三级欧美在线一区| 久久精品视频一区二区| 国产.欧美.日韩| 人人爽香蕉精品| 亚洲一区二区三区视频在线播放 | 亚洲无人区一区| 欧美区在线观看| 亚洲精品你懂的| 精品人伦一区二区色婷婷| 成人亚洲一区二区一| 午夜av电影一区| 欧美国产激情一区二区三区蜜月 | 欧美aⅴ一区二区三区视频| 精品视频1区2区| 精品一区二区三区免费观看 | 亚洲免费观看在线观看| 欧美精品视频www在线观看| 久久99精品国产.久久久久久| 亚洲欧洲av另类| 亚洲女与黑人做爰| 欧美一区二区三区白人| 蜜臀av一区二区| 亚洲一区日韩精品中文字幕| 亚洲免费视频中文字幕| 欧美在线你懂的| 日韩欧美在线网站| 裸体在线国模精品偷拍| 亚洲色图欧美在线| 中文字幕国产一区二区| 最新久久zyz资源站| 精品一区二区三区欧美| 亚洲日本在线天堂| 在线免费观看一区| 成人免费黄色大片| 91网址在线看| 91精品国产综合久久精品| 日韩欧美aaaaaa| 国产网站一区二区三区| 国产精品视频在线看| 樱花影视一区二区| 偷拍一区二区三区四区| 日韩三级精品电影久久久| 欧美三级中文字幕在线观看| 91老司机福利 在线| 91豆麻精品91久久久久久| 在线视频亚洲一区| jlzzjlzz欧美大全| 色丁香久综合在线久综合在线观看| 成人午夜私人影院| 成人免费视频app| 色av成人天堂桃色av| 国产亚洲综合性久久久影院| 国产美女精品一区二区三区| 老汉av免费一区二区三区| 日韩av不卡在线观看| 国产自产视频一区二区三区| 91丨porny丨首页| 日韩欧美亚洲另类制服综合在线| 久久免费视频色| 亚洲国产成人精品视频| 国产激情视频一区二区在线观看| 欧美中文一区二区三区| 久久毛片高清国产| 一区二区三区高清| 韩国成人在线视频| 在线观看日韩av先锋影音电影院| 26uuu精品一区二区在线观看| 国产精品久久久一本精品| 午夜精品成人在线视频| 成人国产精品免费| 精品成人佐山爱一区二区| 亚洲欧美激情在线| 丁香一区二区三区| 日韩一级片网站| 亚洲成a人片在线不卡一二三区 | 亚洲亚洲精品在线观看| 国产91露脸合集magnet| 日韩一区二区视频| 亚洲午夜在线视频| 精品一区二区国语对白| 国产精品久久久久桃色tv| 日本中文字幕一区二区视频 | 欧美一区二区三区人| 欧美国产欧美亚州国产日韩mv天天看完整 | 亚洲免费观看视频| 在线观看视频91| 欧美日韩日本视频| 日韩欧美二区三区| 调教+趴+乳夹+国产+精品| 99国产精品99久久久久久| 久久精品免视看| 精品一区中文字幕| 精品少妇一区二区三区日产乱码 | 中文字幕一区在线观看| 国内久久精品视频| 精品久久久久久久一区二区蜜臀| 日日摸夜夜添夜夜添亚洲女人| av资源网一区| 亚洲国产成人在线| 国产精品综合久久| 欧美精品一区二区三区视频 | 国产亚洲精品aa| 国产美女精品在线| 久久久噜噜噜久久人人看| 韩国av一区二区三区四区| 日韩欧美一级特黄在线播放| 日本成人在线不卡视频| 制服丝袜在线91| 免费在线一区观看| 日韩视频在线你懂得| 人人精品人人爱| 精品国产一区二区亚洲人成毛片 | 日韩一区二区三区视频在线观看| 日韩 欧美一区二区三区| 91精品国产免费| 麻豆成人久久精品二区三区小说| 5566中文字幕一区二区电影 | 五月天激情综合网| 欧美日高清视频| 日本sm残虐另类| 久久久一区二区三区| 国产成人aaa| 综合中文字幕亚洲| 欧亚一区二区三区| 奇米精品一区二区三区在线观看 | 亚洲色图视频免费播放| 777精品伊人久久久久大香线蕉| 国产精品影视在线观看| 日本成人中文字幕| 国内精品写真在线观看| 午夜不卡av免费| 亚洲一卡二卡三卡四卡五卡| 国产日韩在线不卡| 国产午夜精品久久久久久久| 欧美日韩亚洲综合| 日韩欧美中文一区二区| 1024亚洲合集| 国产大陆a不卡| 亚洲人成网站影音先锋播放| 欧美精品一卡两卡| 国产做a爰片久久毛片|