阅读:905回复:1
vb问题
在vb里想用windows api打开串口,可是不行大家看看什么毛病:Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Dim fHandle As Long fHandle = CreateFile("COM1", GENERIC_WRITE Or GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL Or FILE_FLAG_OVERLAPPED, 0) 返回的总是错误句柄 |
|
沙发#
发布于:2004-04-23 13:14
Private Declare Function CreateFile Lib \"kernel32\" Alias \"CreateFileA\" (Byref 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
看行不行 |
|
|