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

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

?? dwcomm.cls

?? modem設備檢測程序
?? CLS
?? 第 1 頁 / 共 2 頁
字號:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "dwComm"
Attribute VB_Creatable = True
Attribute VB_Exposed = False
' dwDCB - Device Communication Block utility class
' Part of the Desaware API Class Library
' Copyright (c) 1996 by Desaware.
' All Rights Reserved
Option Explicit

Private Type COMMTIMEOUTS
        ReadIntervalTimeout As Long
        ReadTotalTimeoutMultiplier As Long
        ReadTotalTimeoutConstant As Long
        WriteTotalTimeoutMultiplier As Long
        WriteTotalTimeoutConstant As Long
End Type

Private Type OVERLAPPED
        Internal As Long
        InternalHigh As Long
        offset As Long
        OffsetHigh As Long
        hEvent As Long
End Type

' Private members
Private timeouts As COMMTIMEOUTS
Private handle As Long  ' Comm handle
Private devname$ ' Com1, com2 or other compatible comm device

' Public members
Public DCB As dwDCB

' Current state indicators
' Holds output data that arrives while an output transfer is in progress
Private PendingOutput$
Private CurrentEventMask&   ' Non zero if events are being watched for
' Buffers for overlapped input and output
' Must take this approach due to VB's ability to move strings
Private CurrentInputBuffer&
Private CurrentOutputBuffer&
Private TriggeredEvents&    ' Variable to load with event results

' Three overlapped structures,
' 0 = read, 1 = write, 2 = waitevent
Private overlaps(2) As OVERLAPPED
' Indicates background operation is in progress
Private inprogress(2) As Boolean
' Amount of data transferred on write
Private DataWritten&
Private DataRead&
Private EventResults&

' This object must have two functions
' CommInput(dev As dwComm, info As String)
' CommEvent(dev As dwComm, event as long)
Private CallbackObject As Object

' Declarations
Private Declare Function apiSetCommTimeouts Lib "kernel32" Alias "SetCommTimeouts" (ByVal hFile As Long, lpCommTimeouts As COMMTIMEOUTS) As Long
Private Declare Function apiGetCommTimeouts Lib "kernel32" Alias "GetCommTimeouts" (ByVal hFile As Long, lpCommTimeouts As COMMTIMEOUTS) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function SetupComm Lib "kernel32" (ByVal hFile As Long, ByVal dwInQueue As Long, ByVal dwOutQueue As Long) As Long
Private Declare Function GetCommModemStatus Lib "kernel32" (ByVal hFile As Long, lpModemStat As Long) As Long
Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Declare Function lstrcpyFromBuffer Lib "kernel32" Alias "lstrcpynA" (ByVal lpString1 As String, ByVal buffer As Long, ByVal iMaxLength As Long) As Long
Private Declare Function lstrcpyToBuffer Lib "kernel32" Alias "lstrcpynA" (ByVal buffer As Long, ByVal lpString2 As String, ByVal iMaxLength As Long) As Long
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As Long
Private Declare Function GetLastError Lib "kernel32" () As Long
Private Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (ByVal lpEventAttributes As Long, ByVal bManualReset As Long, ByVal bInitialState As Long, ByVal lpName As String) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, lpOverlapped As OVERLAPPED) As Long
Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, lpOverlapped As OVERLAPPED) As Long
Private Declare Function SetCommMask Lib "kernel32" (ByVal hFile As Long, ByVal dwEvtMask As Long) As Long
Private Declare Function ClearCommError Lib "kernel32" (ByVal hFile As Long, lpErrors As Long, ByVal l As Long) As Long
Private Declare Function WaitCommEvent Lib "kernel32" (ByVal hFile As Long, lpEvtMask As Long, lpOverlapped As OVERLAPPED) As Long

Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Private Const OPEN_EXISTING = 3
Private Const FILE_FLAG_OVERLAPPED = &H40000000
Private Const INVALID_HANDLE_VALUE = -1
Private Const GMEM_FIXED = &H0
Private Const ClassBufferSizes% = 1024
Private Const ERROR_IO_PENDING = 997 '  dderror
Private Const WAIT_TIMEOUT = &H102&

' GetCommModemStatus flags
Private Const MS_CTS_ON = &H10&
Private Const MS_DSR_ON = &H20&
Private Const MS_RING_ON = &H40&
Private Const MS_RLSD_ON = &H80&

' Error values
Private Const CLASS_NAME$ = "dwComm"
Private Const ERR_NOCOMMACCESS = 31010
Private Const ERR_UNINITIALIZED = 31011
Private Const ERR_MODEMSTATUS = 31012
Private Const ERR_READFAIL = 31013
Private Const ERR_EVENTFAIL = 31014

Private Const EV_RXCHAR = &H1                '  Any Character received
Private Const EV_RXFLAG = &H2                '  Received certain character
Private Const EV_TXEMPTY = &H4               '  Transmitt Queue Empty
Private Const EV_CTS = &H8                   '  CTS changed state
Private Const EV_DSR = &H10                  '  DSR changed state
Private Const EV_RLSD = &H20                 '  RLSD changed state
Private Const EV_BREAK = &H40                '  BREAK received
Private Const EV_ERR = &H80                  '  Line status error occurred
Private Const EV_RING = &H100                '  Ring signal detected
Private Const EV_PERR = &H200                '  Printer error occured
Private Const EV_RX80FULL = &H400            '  Receive buffer is 80 percent full
Private Const EV_EVENT1 = &H800              '  Provider specific event 1
Private Const EV_EVENT2 = &H1000             '  Provider specific event 2

Private Const CE_RXOVER = &H1                '  Receive Queue overflow
Private Const CE_OVERRUN = &H2               '  Receive Overrun Error
Private Const CE_RXPARITY = &H4              '  Receive Parity Error
Private Const CE_FRAME = &H8                 '  Receive Framing error
Private Const CE_BREAK = &H10                '  Break Detected
Private Const CE_TXFULL = &H100              '  TX Queue is full

' An empty string with a single null character
Private EmptyString As String * 1

Private Sub Class_Initialize()
    Dim olnum%
    Set DCB = New dwDCB
    CurrentInputBuffer = GlobalAlloc(GMEM_FIXED, ClassBufferSizes + 1)
    CurrentOutputBuffer = GlobalAlloc(GMEM_FIXED, ClassBufferSizes + 1)
    CurrentEventMask = EV_ERR
    EmptyString = Chr$(0)
    ' Create event objects for the background transfer
    For olnum = 0 To 2
        overlaps(olnum).hEvent = CreateEvent(0, True, False, vbNullString)
    Next olnum
End Sub

Private Sub Class_Terminate()
    Dim olnum
    ' Close existing comm device
    Call CloseComm
    ' Dump the event objects
    For olnum = 0 To 2
        Call CloseHandle(overlaps(olnum).hEvent)
    Next olnum
    Set DCB = Nothing   ' Be sure DCB is free
    Call GlobalFree(CurrentInputBuffer)
    Call GlobalFree(CurrentOutputBuffer)
    
End Sub

' Useful error routines
Private Sub DeviceNotOpenedError()
    Err.Raise vbObjectError + ERR_UNINITIALIZED, CLASS_NAME, "Communication Device is not open"
End Sub

Private Sub ModemStatusError()
    Err.Raise vbObjectError + ERR_MODEMSTATUS, CLASS_NAME, "GetCommModemStatus Failed"
End Sub


'-----------------------------------------------
' Timeout property access follows
'-----------------------------------------------
Public Property Get ReadIntervalTimeout() As Long
    ReadIntervalTimeout = timeouts.ReadIntervalTimeout
End Property

Public Property Let ReadIntervalTimeout(vNewValue As Long)
    timeouts.ReadIntervalTimeout = vNewValue
End Property

Public Property Get ReadTotalTimeoutMultiplier() As Long
    ReadTotalTimeoutMultiplier = timeouts.ReadTotalTimeoutMultiplier
End Property

Public Property Let ReadTotalTimeoutMultiplier(vNewValue As Long)
    timeouts.ReadTotalTimeoutMultiplier = vNewValue
End Property


Public Property Get ReadTotalTimeoutConstant() As Long
    ReadTotalTimeoutConstant = timeouts.ReadTotalTimeoutConstant
End Property

Public Property Let ReadTotalTimeoutConstant(vNewValue As Long)
    timeouts.ReadTotalTimeoutConstant = ReadTotalTimeoutConstant
End Property

Public Property Get WriteTotalTimeoutMultiplier() As Long
    WriteTotalTimeoutMultiplier = timeouts.WriteTotalTimeoutMultiplier
End Property

Public Property Let WriteTotalTimeoutMultiplier(vNewValue As Long)
    timeouts.WriteTotalTimeoutMultiplier = WriteTotalTimeoutMultiplier
End Property

Public Property Get WriteTotalTimeoutConstant() As Long
    WriteTotalTimeoutConstant = timeouts.WriteTotalTimeoutConstant
End Property

Public Property Let WriteTotalTimeoutConstant(vNewValue As Long)
    timeouts.WriteTotalTimeoutConstant = WriteTotalTimeoutConstant
End Property

' The device handle is read only
Public Property Get hCommDev() As Long
    hCommDev = handle
End Property

' This property is read only
Public Property Get DeviceName() As String
    DeviceName = devname
End Property

Public Sub GetCommTimeouts()
    ' Is there any real need to report errors here?
    If handle = 0 Then Exit Sub
    Call apiGetCommTimeouts(handle, timeouts)
End Sub

Public Function SetCommTimeouts() As Long
    If handle = 0 Then Exit Function ' Returns false
    SetCommTimeouts = apiSetCommTimeouts(handle, timeouts) <> 0
End Function

' The main function for opening a comm device
' Receives device name (com?) and optionally the size of the internal input and output queues
Public Function OpenComm(CommDeviceName As String, Notify As Object, Optional cbInQueue, Optional cbOutQueue) As Long
    ' Close an existing port when reopening
    If handle <> 0 Then CloseComm
    devname = CommDeviceName
    Set CallbackObject = Notify
    handle = CreateFile(devname, GENERIC_READ Or GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0)
    If handle = INVALID_HANDLE_VALUE Then Err.Raise vbObjectError + ERR_NOCOMMACCESS, CLASS_NAME, "Unable to open communications device"
    ' If the input and output queue size is specified, set it now
    If Not (IsMissing(cbInQueue) Or IsMissing(cbOutQueue)) Then
        Call SetupComm(handle, cbInQueue, cbOutQueue)
    Else
        Call SetupComm(handle, 8192, 1024)
    End If
    ' Ok, we've got the comm port. Initialize the timeouts
    GetCommTimeouts
    ' Set some default timeouts
    timeouts.ReadIntervalTimeout = 1
    timeouts.ReadTotalTimeoutMultiplier = 0
    timeouts.ReadTotalTimeoutConstant = 10
    timeouts.WriteTotalTimeoutMultiplier = 1
    timeouts.WriteTotalTimeoutConstant = 1
    SetCommTimeouts
    ' Initialize the DCB to the current device parameters
    Call DCB.GetCommState(Me)
    Call SetCommMask(handle, CurrentEventMask)
    StartInput
End Function

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩av亚洲一区二区图片| 日韩一级黄色大片| 欧美精品xxxxbbbb| 国产欧美精品国产国产专区| 亚洲成av人片| gogo大胆日本视频一区| 精品久久一区二区| 日韩国产欧美视频| 在线精品观看国产| 中文字幕第一区二区| 久久69国产一区二区蜜臀| 欧美亚洲国产一区二区三区| 国产日韩精品视频一区| 老司机精品视频在线| 欧美在线免费观看视频| 亚洲四区在线观看| 大桥未久av一区二区三区中文| 日韩一级大片在线| 日韩国产一区二| 欧美日韩视频在线一区二区| 亚洲欧美一区二区在线观看| 成人在线综合网| 久久亚洲精品小早川怜子| 日本一不卡视频| 7777女厕盗摄久久久| 亚洲chinese男男1069| 在线观看一区二区视频| √…a在线天堂一区| 成人h动漫精品一区二区| 欧美激情综合五月色丁香小说| 国产在线精品一区二区| 精品国产一区二区三区久久影院 | 国产不卡一区视频| 久久久噜噜噜久久中文字幕色伊伊| 午夜精品久久久久久久| 欧美三级电影一区| 午夜精彩视频在线观看不卡| 欧美日韩在线播放三区四区| 亚洲国产精品久久不卡毛片| 欧美色综合网站| 亚洲成人动漫av| 制服丝袜一区二区三区| 毛片av中文字幕一区二区| 日韩一级免费观看| 国产一区二区看久久| 亚洲国产高清aⅴ视频| 色综合一个色综合亚洲| 亚洲图片欧美一区| 日韩视频免费观看高清在线视频| 久久超级碰视频| 国产精品毛片无遮挡高清| 色系网站成人免费| 石原莉奈在线亚洲三区| 久久综合狠狠综合久久综合88 | 午夜精品一区二区三区电影天堂 | 亚洲国产精品精华液2区45| 成人av在线网| 亚洲高清免费在线| 欧美精品一区二| av日韩在线网站| 日日嗨av一区二区三区四区| 精品国产乱码久久久久久蜜臀| 粉嫩av亚洲一区二区图片| 一区二区三区在线不卡| 日韩一区二区在线观看视频| 懂色av一区二区在线播放| 亚洲三级在线看| 欧美成人女星排行榜| 成人动漫一区二区在线| 日韩精品欧美精品| 国产人久久人人人人爽| 欧美最猛性xxxxx直播| 国产综合色视频| 一区二区三区鲁丝不卡| www日韩大片| 欧美日韩在线免费视频| 国产精品一区二区久久不卡| 一区二区在线观看av| 久久久噜噜噜久噜久久综合| 欧美在线看片a免费观看| 国产在线精品一区二区三区不卡 | 色综合天天综合网天天狠天天| 日韩高清一区二区| 亚洲黄网站在线观看| 久久久久久久综合日本| 欧美精品日日鲁夜夜添| 93久久精品日日躁夜夜躁欧美| 久久精品国产精品青草| 亚洲国产人成综合网站| 最近中文字幕一区二区三区| 精品国偷自产国产一区| 欧美丰满高潮xxxx喷水动漫| 91热门视频在线观看| 成人综合在线网站| 精品一区在线看| 视频一区视频二区中文| 亚洲资源在线观看| 亚洲三级在线观看| 国产精品伦理在线| 久久精品一区二区三区不卡牛牛| 91麻豆精品国产91久久久久久| 91麻豆123| 成人免费观看视频| 国产激情精品久久久第一区二区| 青青草原综合久久大伊人精品优势| 亚洲黄色av一区| 综合婷婷亚洲小说| 久久精品亚洲精品国产欧美kt∨| 日韩免费高清视频| 欧美大片一区二区| 日韩欧美激情在线| 日韩精品一区二| 精品国产乱码久久久久久久| 欧美绝品在线观看成人午夜影视| 色噜噜夜夜夜综合网| 色偷偷成人一区二区三区91| 91玉足脚交白嫩脚丫在线播放| eeuss鲁片一区二区三区在线观看| 国产成人免费高清| 成人黄页在线观看| www.亚洲色图| 色狠狠综合天天综合综合| 在线影视一区二区三区| 欧美在线观看视频一区二区三区| 色8久久人人97超碰香蕉987| 欧美性三三影院| 正在播放亚洲一区| 精品99一区二区三区| 国产情人综合久久777777| 国产精品久久三| 一区二区三区四区不卡在线 | 欧美国产日本视频| 中文字幕一区二区三区不卡 | 久久久三级国产网站| 国产亚洲一区二区三区在线观看| 欧美激情一区二区三区蜜桃视频| 国产精品嫩草99a| 亚洲一级二级在线| 蜜臀av性久久久久蜜臀aⅴ流畅 | 久久久噜噜噜久噜久久综合| 国产精品久久久久久久久动漫| 亚洲欧美国产三级| 五月天丁香久久| 国产一区二区美女诱惑| 99精品视频一区| 制服丝袜在线91| 欧美激情在线免费观看| 亚洲一区二区高清| 国产精品自在在线| 在线一区二区观看| 精品电影一区二区| 亚洲色图19p| 久久99国产精品尤物| 91麻豆6部合集magnet| 欧美电影免费观看完整版| 国产精品对白交换视频 | 91精品国模一区二区三区| 久久午夜电影网| 亚洲一区二区三区爽爽爽爽爽| 久久国产综合精品| 色网站国产精品| 久久精品人人做人人综合 | 日本女优在线视频一区二区| 国产成人午夜精品影院观看视频| 欧美午夜影院一区| 欧美国产精品专区| 蜜桃一区二区三区在线观看| 97se亚洲国产综合自在线| 日韩精品一区二区三区蜜臀| 一区二区三区毛片| 豆国产96在线|亚洲| 日韩欧美专区在线| 亚洲综合色成人| 99久久国产综合精品麻豆| 欧美zozozo| 日日骚欧美日韩| 91福利在线观看| 国产精品成人一区二区艾草| www.亚洲激情.com| 2019国产精品| 另类小说图片综合网| 8x8x8国产精品| 一区二区三区不卡视频| 99精品视频免费在线观看| 久久精子c满五个校花| 美女视频黄a大片欧美| 欧美人牲a欧美精品| 樱花草国产18久久久久| 99re免费视频精品全部| 国产精品丝袜91| 成人晚上爱看视频| 亚洲国产岛国毛片在线| 国产高清不卡一区| 久久久久国产免费免费 | www.一区二区| 中文字幕在线免费不卡| 成人97人人超碰人人99| 亚洲欧洲另类国产综合| 成人动漫视频在线| 国产精品国产三级国产普通话99|