亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日本v片在线高清不卡在线观看| 久久久亚洲高清| 欧美精品vⅰdeose4hd| 欧美成人伊人久久综合网| 亚洲大片免费看| 韩国欧美一区二区| 欧美性大战久久久久久久蜜臀| 日韩欧美国产综合在线一区二区三区| 一区精品在线播放| 久久av老司机精品网站导航| caoporn国产精品| 91精品国产色综合久久| 成人免费在线观看入口| 精品无码三级在线观看视频| 欧美三级日本三级少妇99| 久久精品亚洲精品国产欧美kt∨| 亚洲成人免费看| av资源网一区| 亚洲国产精品激情在线观看| 免费亚洲电影在线| 欧美日韩在线综合| 成人欧美一区二区三区黑人麻豆 | 首页国产丝袜综合| 成人小视频免费观看| 精品国一区二区三区| 亚洲第一福利一区| 91蝌蚪porny成人天涯| 国产日本亚洲高清| 国产乱子伦视频一区二区三区| 欧美精品日韩精品| 亚洲成av人片在线观看| 91丨九色丨蝌蚪丨老版| 国产精品美女久久久久久久久久久 | 亚洲色欲色欲www| 成人黄色电影在线| 亚洲精品高清在线| 91小视频免费看| 亚洲人快播电影网| 91在线国内视频| 亚洲欧洲国产专区| 色哦色哦哦色天天综合| 亚洲色图另类专区| 色吊一区二区三区| 亚洲一卡二卡三卡四卡| 欧美日韩日本视频| 蜜桃av一区二区在线观看| 日韩一区二区三区四区五区六区| 日本成人在线看| ww亚洲ww在线观看国产| 国产高清不卡一区| 国产精品成人在线观看| 在线视频观看一区| 日本亚洲欧美天堂免费| 日韩免费观看高清完整版在线观看| 日本午夜一区二区| 久久久蜜桃精品| 99视频热这里只有精品免费| 亚洲免费大片在线观看| 欧美日韩精品一区二区三区四区| 日韩电影一区二区三区四区| 日韩精品一区二区三区四区| 国产精品中文字幕日韩精品| 国产精品不卡在线| 欧美日韩一区三区| 国内国产精品久久| 亚洲欧美怡红院| 欧美卡1卡2卡| 国产精品亚洲成人| 一区二区在线电影| 日韩久久免费av| 99久免费精品视频在线观看| 亚洲一区二区三区爽爽爽爽爽| 欧美日韩精品欧美日韩精品| 亚洲欧洲av在线| 亚洲va欧美va人人爽| 久久精品久久综合| 欧美肥胖老妇做爰| 久久精子c满五个校花| 久久综合色之久久综合| 亚洲综合区在线| 欧美二区在线观看| 日韩精品五月天| 国模套图日韩精品一区二区| 一本色道久久综合亚洲精品按摩| 久久精品综合网| 99精品视频一区| 亚洲免费观看高清完整版在线观看| 成人午夜激情在线| 最新欧美精品一区二区三区| 日本久久电影网| 免费看日韩精品| 久久久久久久精| 欧美日韩亚洲国产综合| 蜜桃91丨九色丨蝌蚪91桃色| 日本一区二区三级电影在线观看| 国产精品乡下勾搭老头1| 日韩av中文字幕一区二区三区| 久久国产精品区| 久久久久国产精品人| 亚洲va欧美va人人爽午夜| 欧美一级久久久| 亚洲色图第一区| 精品99一区二区三区| 日韩高清一区在线| 国产欧美日韩三级| 青青草一区二区三区| 亚洲欧美综合在线精品| 成人久久18免费网站麻豆| 一区二区三区欧美在线观看| www.日韩精品| 丁香啪啪综合成人亚洲小说| 国产精品二区一区二区aⅴ污介绍| 国内一区二区视频| 美女一区二区久久| 久久欧美中文字幕| 欧美一区二区三区男人的天堂| 91国模大尺度私拍在线视频| fc2成人免费人成在线观看播放| 国产成人精品免费| 国产激情一区二区三区桃花岛亚洲| 久久精品国产色蜜蜜麻豆| 奇米一区二区三区av| 日本中文字幕一区| 蜜桃视频在线观看一区| 麻豆国产91在线播放| 久久99国产乱子伦精品免费| 蜜桃视频在线观看一区| 久久 天天综合| 国产一区不卡视频| 国产91丝袜在线18| 99久精品国产| 欧美怡红院视频| 欧美精品三级日韩久久| 欧美电影免费提供在线观看| 日韩欧美国产三级| 日本一区二区免费在线观看视频| 国产三级欧美三级日产三级99| 欧美激情综合在线| 中文字幕色av一区二区三区| 亚洲一区二区三区中文字幕在线| 亚洲国产另类av| 六月丁香综合在线视频| 粉嫩一区二区三区在线看| 99精品欧美一区| 在线免费精品视频| 日韩亚洲欧美中文三级| 国产亚洲欧美一级| 一区二区在线观看视频在线观看| 午夜视频一区在线观看| 国产综合色产在线精品| av电影天堂一区二区在线 | 国产一区二区三区在线观看精品| 国产美女在线观看一区| 91在线一区二区三区| 3d动漫精品啪啪1区2区免费| 国产亚洲一区二区三区四区 | 日韩免费在线观看| 亚洲国产成人午夜在线一区| 夜夜嗨av一区二区三区四季av | 精品久久人人做人人爱| 中文字幕一区二区三区四区| 亚洲综合激情网| 国产成人自拍网| 欧美日韩你懂的| 国产欧美一区二区精品性色| 亚洲香肠在线观看| 国产1区2区3区精品美女| 欧美日韩久久久久久| 国产精品三级视频| 日本sm残虐另类| 日本精品一区二区三区四区的功能| 日韩精品一区二区三区swag| 一区二区三区国产| 成人国产一区二区三区精品| 日韩亚洲欧美在线| 午夜精品久久久久久久99樱桃| 成人中文字幕在线| 久久久久久久久久美女| 午夜成人免费视频| 色婷婷国产精品| 国产精品国产成人国产三级| 美腿丝袜亚洲综合| 91精品久久久久久蜜臀| 一区二区三区影院| av在线播放一区二区三区| 日韩精品一区二区三区swag| 亚洲最大成人网4388xx| 亚洲欧美aⅴ...| 成人免费毛片a| 日韩精品一区二区在线观看| 亚洲国产cao| 在线视频一区二区免费| 香蕉久久夜色精品国产使用方法 | 欧美岛国在线观看| 久久66热re国产| 欧美大片一区二区三区| 国产精品伦理一区二区| 久久91精品久久久久久秒播| 国产精选一区二区三区| 精品久久久久久久久久久久包黑料|