丢掉MSCOMM控件吧,除非你的buffer能远远大于接收数据(比如1秒的数据量)
即使如此,尽量使用buffer满的事件,因为char收到时间,会超级频繁,就像中断多了丢点东西就很正常了
VB一样可以用API函数,那个声明:
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long |