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

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

?? frmmain.frm

?? VB和USB通訊示例
?? FRM
?? 第 1 頁 / 共 2 頁
字號:
VERSION 5.00
Begin VB.Form frmMain 
   Caption         =   "USB Complete"
   ClientHeight    =   4392
   ClientLeft      =   252
   ClientTop       =   336
   ClientWidth     =   6132
   LinkTopic       =   "Form1"
   ScaleHeight     =   4392
   ScaleWidth      =   6132
   Begin VB.Timer tmrContinuousDataCollect 
      Left            =   120
      Top             =   3960
   End
   Begin VB.Frame fraSendAndReceive 
      Caption         =   "Send and Receive Data"
      Height          =   1692
      Left            =   3960
      TabIndex        =   7
      Top             =   120
      Width           =   2052
      Begin VB.CommandButton cmdContinuous 
         Caption         =   "Continuous"
         Height          =   372
         Left            =   360
         TabIndex        =   9
         Top             =   1080
         Width           =   1452
      End
      Begin VB.CommandButton cmdOnce 
         Caption         =   "Once"
         Height          =   372
         Left            =   360
         TabIndex        =   8
         Top             =   360
         Width           =   1452
      End
   End
   Begin VB.Frame fraBytesReceived 
      Caption         =   "Bytes Received"
      Height          =   1692
      Left            =   2400
      TabIndex        =   4
      Top             =   120
      Width           =   1452
      Begin VB.TextBox txtBytesReceived 
         Height          =   732
         Left            =   360
         MultiLine       =   -1  'True
         TabIndex        =   5
         Top             =   600
         Width           =   732
      End
   End
   Begin VB.Frame fraBytesToSend 
      Caption         =   "Bytes to Send"
      Height          =   1692
      Left            =   120
      TabIndex        =   1
      Top             =   120
      Width           =   2172
      Begin VB.CheckBox chkAutoincrement 
         Caption         =   "Autoincrement values"
         Height          =   372
         Left            =   240
         TabIndex        =   6
         Top             =   1200
         Width           =   2412
      End
      Begin VB.ComboBox cboByte1 
         Height          =   288
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   840
         Width           =   1212
      End
      Begin VB.ComboBox cboByte0 
         Height          =   288
         Left            =   240
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   360
         Width           =   1212
      End
   End
   Begin VB.Timer tmrDelay 
      Enabled         =   0   'False
      Left            =   120
      Top             =   11400
   End
   Begin VB.ListBox lstResults 
      Height          =   2352
      Left            =   120
      TabIndex        =   0
      Top             =   1920
      Width           =   5892
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'Project: usbhidio.vbp
'Version: 1.1
'Date: 11/20/99
'Copyright 1999 by Jan Axelson (jan@lvr.com)
'
'Purpose: demonstrates USB communications with an HID-class device
'Description:
'Finds an attached device that matches specific vendor and product IDs.
'Retrieves the device's capabilities.
'Sends two bytes to the device using Input reports.
'Receives two bytes from the device in Output reports.
'(For testing, the current device firmware adds 1 to the received bytes
'and sends them back.)
'A list box displays the data sent and received,
'along with error and status messages.
'Combo boxes enable you to select data to send, and to select 1-time or
'continuous transfers.

'The companion device firmware is usbhidio.asm,
'for Cypress Semiconductor's CY7C63001 USB Microcontroller.
'For more information, visit Lakeview Research at http://www.lvr.com .

'Send comments, bug reports, etc. to jan@lvr.com .

'Changes and updates:
'11/20/99. Revised a few of the comments.
'v1.1 added Else statement in InitializeDisplay routine
'so both combo boxes have all of the values.

Dim Capabilities As HIDP_CAPS
Dim DataString As String
Dim DetailData As Long
Dim DetailDataBuffer() As Byte
Dim DeviceAttributes As HIDD_ATTRIBUTES
Dim DevicePathName As String
Dim DeviceInfoSet As Long
Dim ErrorString As String
Dim HidDevice As Long
Dim LastDevice As Boolean
Dim MyDeviceDetected As Boolean
Dim MyDeviceInfoData As SP_DEVINFO_DATA
Dim MyDeviceInterfaceDetailData As SP_DEVICE_INTERFACE_DETAIL_DATA
Dim MyDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA
Dim Needed As Long
Dim OutputReportData(7) As Byte
Dim PreparsedData As Long
Dim Result As Long
Dim Timeout As Boolean

'Set these to match the values in the device's firmware and INF file.
Const MyVendorID = &H925
Const MyProductID = &H1234

Function FindTheHid() As Boolean
'Makes a series of API calls to locate the desired HID-class device.
'Returns True if the device is detected, False if not detected.

Dim Count As Integer
Dim GUIDString As String
Dim HidGuid As GUID
Dim MemberIndex As Long

LastDevice = False
MyDeviceDetected = False

'******************************************************************************
'HidD_GetHidGuid
'Get the GUID for all system HIDs.
'Returns: the GUID in HidGuid.
'The routine doesn't return a value in Result
'but the routine is declared as a function for consistency with the other API calls.
'******************************************************************************

Result = HidD_GetHidGuid(HidGuid)
Call DisplayResultOfAPICall("GetHidGuid")

'Display the GUID.
GUIDString = _
    Hex$(HidGuid.Data1) & "-" & _
    Hex$(HidGuid.Data2) & "-" & _
    Hex$(HidGuid.Data3) & "-"

For Count = 0 To 7
    'Ensure that each of the 8 bytes in the GUID displays two characters.
    If HidGuid.Data4(Count) >= &H10 Then
        GUIDString = GUIDString & Hex$(HidGuid.Data4(Count)) & " "
    Else
        GUIDString = GUIDString & "0" & Hex$(HidGuid.Data4(Count)) & " "
    End If
Next Count

lstResults.AddItem "  GUID for system HIDs: " & GUIDString

'******************************************************************************
'SetupDiGetClassDevs
'Returns: a handle to a device information set for all installed devices.
'Requires: the HidGuid returned in GetHidGuid.
'******************************************************************************

DeviceInfoSet = SetupDiGetClassDevs _
    (HidGuid, _
    vbNullString, _
    0, _
    (DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE))
    
Call DisplayResultOfAPICall("SetupDiClassDevs")
DataString = GetDataString(DeviceInfoSet, 32)

'******************************************************************************
'SetupDiEnumDeviceInterfaces
'On return, MyDeviceInterfaceData contains the handle to a
'SP_DEVICE_INTERFACE_DATA structure for a detected device.
'Requires:
'the DeviceInfoSet returned in SetupDiGetClassDevs.
'the HidGuid returned in GetHidGuid.
'An index to specify a device.
'******************************************************************************

'Begin with 0 and increment until no more devices are detected.
MemberIndex = 0

Do
    'The cbSize element of the MyDeviceInterfaceData structure must be set to
    'the structure's size in bytes. The size is 28 bytes.
    MyDeviceInterfaceData.cbSize = LenB(MyDeviceInterfaceData)
    Result = SetupDiEnumDeviceInterfaces _
        (DeviceInfoSet, _
        0, _
        HidGuid, _
        MemberIndex, _
        MyDeviceInterfaceData)
    
    Call DisplayResultOfAPICall("SetupDiEnumDeviceInterfaces")
    If Result = 0 Then LastDevice = True
    
    'If a device exists, display the information returned.
    If Result <> 0 Then
        lstResults.AddItem "  DeviceInfoSet for device #" & CStr(MemberIndex) & ": "
        lstResults.AddItem "  cbSize = " & CStr(MyDeviceInterfaceData.cbSize)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data1 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data1)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data2 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data2)
        lstResults.AddItem _
            "  InterfaceClassGuid.Data3 = " & Hex$(MyDeviceInterfaceData.InterfaceClassGuid.Data3)
        lstResults.AddItem _
            "  Flags = " & Hex$(MyDeviceInterfaceData.Flags)
    
        
        '******************************************************************************
        'SetupDiGetDeviceInterfaceDetail
        'Returns: an SP_DEVICE_INTERFACE_DETAIL_DATA structure
        'containing information about a device.
        'To retrieve the information, call this function twice.
        'The first time returns the size of the structure in Needed.
        'The second time returns a pointer to the data in DeviceInfoSet.
        'Requires:
        'A DeviceInfoSet returned by SetupDiGetClassDevs and
        'an SP_DEVICE_INTERFACE_DATA structure returned by SetupDiEnumDeviceInterfaces.
        '*******************************************************************************
        
        MyDeviceInfoData.cbSize = Len(MyDeviceInfoData)
        Result = SetupDiGetDeviceInterfaceDetail _
           (DeviceInfoSet, _
           MyDeviceInterfaceData, _
           0, _
           0, _
           Needed, _
           0)
        
        DetailData = Needed
            
        Call DisplayResultOfAPICall("SetupDiGetDeviceInterfaceDetail")
        lstResults.AddItem "  (OK to say too small)"
        lstResults.AddItem "  Required buffer size for the data: " & Needed
        
        'Store the structure's size.
        MyDeviceInterfaceDetailData.cbSize = _
            Len(MyDeviceInterfaceDetailData)
        
        'Use a byte array to allocate memory for
        'the MyDeviceInterfaceDetailData structure
        ReDim DetailDataBuffer(Needed)
        'Store cbSize in the first four bytes of the array.
        Call RtlMoveMemory _
            (DetailDataBuffer(0), _
            MyDeviceInterfaceDetailData, _
            4)
        
        'Call SetupDiGetDeviceInterfaceDetail again.
        'This time, pass the address of the first element of DetailDataBuffer
        'and the returned required buffer size in DetailData.
        Result = SetupDiGetDeviceInterfaceDetail _
           (DeviceInfoSet, _
           MyDeviceInterfaceData, _
           VarPtr(DetailDataBuffer(0)), _
           DetailData, _
           Needed, _
           0)
        
        Call DisplayResultOfAPICall(" Result of second call: ")
        lstResults.AddItem "  MyDeviceInterfaceDetailData.cbSize: " & _
            CStr(MyDeviceInterfaceDetailData.cbSize)
        
        'Convert the byte array to a string.
        DevicePathName = CStr(DetailDataBuffer())
        'Convert to Unicode.
        DevicePathName = StrConv(DevicePathName, vbUnicode)
        'Strip cbSize (4 bytes) from the beginning.
        DevicePathName = Right$(DevicePathName, Len(DevicePathName) - 4)
        lstResults.AddItem "  Device pathname: "
        lstResults.AddItem "    " & DevicePathName
                
        '******************************************************************************
        'CreateFile
        'Returns: a handle that enables reading and writing to the device.
        'Requires:
        'The DevicePathName returned by SetupDiGetDeviceInterfaceDetail.
        '******************************************************************************
    
        HidDevice = CreateFile _
            (DevicePathName, _
            GENERIC_READ Or GENERIC_WRITE, _
            (FILE_SHARE_READ Or FILE_SHARE_WRITE), _
            0, _
            OPEN_EXISTING, _
            0, _
            0)
            
        Call DisplayResultOfAPICall("CreateFile")
        lstResults.AddItem "  Returned handle: " & Hex$(HidDevice) & "h"
        
        'Now we can find out if it's the device we're looking for.
        
        '******************************************************************************
        'HidD_GetAttributes
        'Requests information from the device.
        'Requires: The handle returned by CreateFile.
        'Returns: an HIDD_ATTRIBUTES structure containing
        'the Vendor ID, Product ID, and Product Version Number.
        'Use this information to determine if the detected device
        'is the one we're looking for.
        '******************************************************************************
        
        'Set the Size property to the number of bytes in the structure.
        DeviceAttributes.Size = LenB(DeviceAttributes)
        Result = HidD_GetAttributes _
            (HidDevice, _
            DeviceAttributes)
            
        Call DisplayResultOfAPICall("HidD_GetAttributes")
        If Result <> 0 Then
            lstResults.AddItem "  HIDD_ATTRIBUTES structure filled without error."
        Else
            lstResults.AddItem "  Error in filling HIDD_ATTRIBUTES structure."
        End If
    
        lstResults.AddItem "  Structure size: " & DeviceAttributes.Size
        lstResults.AddItem "  Vendor ID: " & Hex$(DeviceAttributes.VendorID)
        lstResults.AddItem "  Product ID: " & Hex$(DeviceAttributes.ProductID)
        lstResults.AddItem "  Version Number: " & Hex$(DeviceAttributes.VersionNumber)
        
        'Find out if the device matches the one we're looking for.
        If (DeviceAttributes.VendorID = MyVendorID) And _
            (DeviceAttributes.ProductID = MyProductID) Then
                lstResults.AddItem "  My device detected"
                MyDeviceDetected = True
        Else
                MyDeviceDetected = False
                'If it's not the one we want, close its handle.
                Result = CloseHandle _
                    (HidDevice)
                DisplayResultOfAPICall ("CloseHandle")
        End If
End If
    'Keep looking until we find the device or there are no more left to examine.

    MemberIndex = MemberIndex + 1

Loop Until (LastDevice = True) Or (MyDeviceDetected = True)

If MyDeviceDetected = True Then
    FindTheHid = True
Else
    lstResults.AddItem " Device not found."
End If

End Function

Private Function GetDataString _
    (Address As Long, _
    Bytes As Long) _
As String

'Retrieves a string of length Bytes from memory, beginning at Address.
'Adapted from Dan Appleman's "Win32 API Puzzle Book"

Dim Offset As Integer
Dim Result$

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区5566日韩| 欧美精品aⅴ在线视频| 91麻豆swag| 国产蜜臀97一区二区三区| 欧美日韩和欧美的一区二区| 成人性生交大片免费看视频在线 | 国产在线播放一区三区四| 亚洲一级电影视频| 一区二区在线看| 国产精品天干天干在线综合| 久久久www成人免费无遮挡大片| 51精品久久久久久久蜜臀| 在线观看一区不卡| 日本韩国一区二区三区视频| 91网站视频在线观看| 欧美日韩中文另类| 欧美日韩综合在线免费观看| 欧美高清视频在线高清观看mv色露露十八| 欧美午夜精品一区二区三区| 精品成人一区二区三区| 国产精品青草综合久久久久99| 亚洲欧美激情一区二区| 日本欧美一区二区在线观看| 一区二区三区免费网站| 蜜桃视频在线观看一区| 国产成人福利片| 欧美日韩一区精品| 国产精品丝袜一区| 日韩av一级电影| 国产成人在线视频网址| 欧美日韩午夜精品| 国产日韩欧美精品综合| 亚洲激情图片qvod| 成人伦理片在线| 久久精品夜色噜噜亚洲aⅴ| 综合精品久久久| 不卡的电影网站| 中文天堂在线一区| 国产成人日日夜夜| 国产欧美精品一区二区色综合| 亚洲情趣在线观看| 成人免费高清视频| 欧美激情中文字幕| 国产美女娇喘av呻吟久久| 91麻豆精品国产91久久久| 亚洲欧美国产77777| 成人午夜精品一区二区三区| 日韩欧美国产综合| 日韩国产欧美在线观看| 欧美日韩五月天| 国产精品一区2区| aa级大片欧美| 欧美大白屁股肥臀xxxxxx| 日本亚洲三级在线| 精品久久久久久久久久久久久久久久久| 2017欧美狠狠色| 精品夜夜嗨av一区二区三区| 欧美在线一区二区三区| 亚洲成a人片综合在线| 4438成人网| 国产在线播放一区| 亚洲综合一区二区| 91精品免费在线观看| 国产美女精品人人做人人爽| 亚洲女与黑人做爰| 欧美成人r级一区二区三区| 日韩电影免费一区| 国产欧美一区二区三区网站| 91久久精品国产91性色tv| 欧美96一区二区免费视频| 国产性做久久久久久| 在线这里只有精品| 国产一区二区调教| 亚洲综合另类小说| 国产日韩欧美综合一区| 91视频免费观看| 激情成人综合网| 亚洲精品自拍动漫在线| 亚洲精品一区二区三区福利| 欧美午夜精品一区二区蜜桃| 国产黄色成人av| 免费在线观看精品| 美女mm1313爽爽久久久蜜臀| 久久久噜噜噜久久中文字幕色伊伊| 一本色道久久加勒比精品 | 亚洲激情av在线| 亚洲国产精品t66y| 国产精品传媒视频| 欧美精品一区二区三区四区| 欧美日韩成人一区| 99精品欧美一区二区三区小说 | 成人精品视频.| 成人高清免费观看| 一本色道**综合亚洲精品蜜桃冫 | 欧美一级生活片| 91麻豆精品国产自产在线 | 91精品国产欧美一区二区| 色8久久精品久久久久久蜜| 波多野结衣欧美| 欧美午夜一区二区| 欧美少妇性性性| 欧美日精品一区视频| 欧美成人猛片aaaaaaa| 国产欧美一区二区三区网站| 亚洲黄网站在线观看| 一区二区三区丝袜| 亚洲福利电影网| 国产在线观看一区二区| 成人精品在线视频观看| 欧美日韩一卡二卡三卡| 国产亚洲精品中文字幕| 亚洲国产一区二区视频| 五月婷婷欧美视频| 国产激情91久久精品导航| 欧美区视频在线观看| 日韩免费电影一区| 亚洲裸体在线观看| 国产成人精品免费在线| 欧美精品vⅰdeose4hd| 中文无字幕一区二区三区| 五月综合激情婷婷六月色窝| 91尤物视频在线观看| 精品91自产拍在线观看一区| 亚洲特级片在线| 国产福利一区二区三区视频在线 | 国产亚洲欧美日韩俺去了| 午夜欧美电影在线观看| 狠狠色狠狠色综合系列| 91精品国产麻豆| 亚洲男人的天堂在线观看| 国产麻豆精品视频| 欧美三级资源在线| 亚洲欧美日韩国产手机在线| 国产河南妇女毛片精品久久久| 欧美女孩性生活视频| 亚洲一区二区三区小说| 欧美色综合影院| 日本美女视频一区二区| 7777精品伊人久久久大香线蕉的 | 国产日韩三级在线| 成人短视频下载| 亚洲三级久久久| 91视频免费观看| 亚洲高清免费一级二级三级| 欧美精品一二三| 久久精品国产**网站演员| 欧美mv日韩mv| 国产馆精品极品| 国产精品午夜电影| 欧美色手机在线观看| 日韩成人dvd| 国产女人18毛片水真多成人如厕 | 精品嫩草影院久久| 99这里只有久久精品视频| 亚洲成人你懂的| 26uuu亚洲综合色欧美| 国产成人免费视频一区| 亚洲欧美综合色| 欧美蜜桃一区二区三区| 国产91精品免费| 喷白浆一区二区| 一区二区三区欧美日| 26uuu另类欧美| 欧美日韩免费一区二区三区视频| 爽好多水快深点欧美视频| 久久众筹精品私拍模特| 欧美伊人精品成人久久综合97| 国产一区二区不卡| 亚洲精品中文在线观看| 中文字幕久久午夜不卡| 91精品免费观看| 99久久婷婷国产| 国产真实乱子伦精品视频| 亚洲成人精品在线观看| 午夜影院久久久| 日韩电影在线免费观看| 亚洲超碰97人人做人人爱| 国产精品区一区二区三| 中文字幕一区日韩精品欧美| 亚洲欧美中日韩| 国产精品视频在线看| 国产精品美日韩| 国产精品网站在线观看| 国产精品理论片在线观看| 国产亚洲自拍一区| 成人欧美一区二区三区白人| 亚洲欧洲国产专区| 亚洲国产aⅴ天堂久久| 亚洲电影欧美电影有声小说| 亚洲国产精品久久人人爱蜜臀| 亚洲啪啪综合av一区二区三区| 久久久久久日产精品| 中文av一区二区| 亚洲成年人影院| 国内成人自拍视频| 国产成人av电影在线播放| 风间由美中文字幕在线看视频国产欧美| 国产精品一二三区| 91老师片黄在线观看| 在线播放国产精品二区一二区四区|