VB操作I/O口需调用以下WINAPI函数,这些函数VB6中未带,具体使用请参考“人民邮电出版社”的“VISUAL BASIC 串口通信实例导航”一书第2章的介绍:
Option Explicit
Declare Function MapPhysToLin Lib "WinIo。
dll" (ByVal PhysAddr As Long, ByVal PhysSize As Long, ByRef PhysMemHandle) As Long
Declare Function UnmapPhysicalMemory Lib "WinIo。
dll" (ByVal PhysMemHandle, ByVal LinAddr) As Boolean
Declare Function GetPhysLong Lib "WinIo。dll" (ByVal PhysAddr As Long, ByRef PhysVal As Long) As Boolean
Declare Function SetPhysLong Lib "WinIo。
dll" (ByVal PhysAddr As Long, ByVal PhysVal As Long) As Boolean
Declare Function GetPortVal Lib "WinIo。dll" (ByVal PortAddr As Integer, ByRef PortVal As Long, ByVal bSize As Byte) As Boolean
Declare Function SetPortVal Lib "WinIo。
dll" (ByVal PortAddr As Integer, ByVal PortVal As Long, ByVal bSize As Byte) As Boolean
Declare Function InitializeWinIo Lib "WinIo。
dll" () As Boolean
Declare Function ShutdownWinIo Lib "WinIo。dll" () As Boolean
Declare Function InstallWinIoDriver Lib "WinIo。
dll" (ByVal DriverPath As String, ByVal Mode As Integer) As Boolean
Declare Function RemoveWinIoDriver Lib "WinIo。dll" () As Boolean
。
全部