vb加载winio驱动失败 下面是代码 希望哪位高人指点一下
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vb加载winio驱动失败 下面是代码 希望哪位高人指点一下相关的知识,希望对你有一定的参考价值。
Declare Function MapPhysToLin Lib "WinIo.dll" (ByVal PhysAddr As Long, ByVal PhysSize As Long, ByRef PhysMemHandle) As Long
'映射到一个32位线程空间
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
'清除IO
Declare Function InstallWinIoDriver Lib "WinIo.dll" (ByVal DriverPath As String, ByVal Mode As Integer) As Boolean
'安装IO
Declare Function RemoveWinIoDriver Lib "WinIo.dll" () As Boolean
'卸载IO
' ----以上是WINIO函数声明
Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
'获取扫描码
'-------以上是WIN32 API函数声明
Sub KBCWait4IBE() '
等待键盘缓冲区为空
Dim dwVal As Long
Do
GetPortVal &H64, dwVal, 1
'这句表示从&H64端口读取一个字节并把读出的数据放到变量dwVal中
'GetPortVal函数的用法是GetPortVal 端口号,存放读出数据的变量,读入的长度
Loop While (dwVal And &H2)
End Sub
Public Const KBC_KEY_CMD = &H64 '键盘命令端口
Public Const KBC_KEY_DATA = &H60 '键盘数据端口
Sub MyKeyDown(ByVal vKeyCoad As Long) '写入数据
'这个用来模拟按下键,参数vKeyCoad传入按键的虚拟码
Dim btScancode As Long
btScancode = MapVirtualKey(vKeyCoad, 0)
KBCWait4IBE '发送数据前应该先等待键盘缓冲区为空
SetPortVal KBC_KEY_CMD, &HD2, 1 '
发送键盘写入命令
'SetPortVal函数用于向端口写入数据,它的用法是SetPortVal 端口号,欲写入的数据,写入数据的长度
KBCWait4IBE
SetPortVal
KBC_KEY_DATA , btScancode, 1 '写入按键信息,按下键
End Sub
Sub MyKeyUp(ByVal vKeyCoad As Long)
'这个用来模拟释放键,参数vKeyCoad传入按键的虚拟码
Dim btScancode As Long
btScancode = MapVirtualKey(vKeyCoad, 0)
KBCWait4IBE '等待键盘缓冲区为空
SetPortVal KBC_KEY_CMD, &HD2, 1 '发送键盘写入命令
KBCWait4IBE
SetPortVal KBC_KEY_DATA, (btScancode Or &H80), 1 '写入按键信息,释放键
End Sub
上面是模块
~~~~~~~~~~~~~~
下面是窗口代码
Private Sub Form_Load()
If InitializeWinIo = False Then
'用InitializeWinIo函数加载驱动程序,如果成功会返回true否则返回false
MsgBox "驱动程序加载失败!"
Unload Me
End If
End Sub
运行后 提示:驱动程序加载失败
您好,我们说胎儿侧脑室正常内径是小于10mm,您的宝宝内径刚好10mm,处于临界值,不能说一定要拿掉,因为并未诊断存在疾病,只能说有这样的可能性,只能说侧脑室稍扩张,要结合别的项目综合考虑,如有无合并羊水过多或过少,我建议您别太紧张,单是侧脑室内径10mm不要紧张,也许过段时间测量就正常了,正常双肾也可以少量积液是因为宝宝憋尿所致,我们成年人憋尿也可以引起少量积液是属于生理性的,现在您要做的就是去上级医院再次检查有无合并其他问题,如羊水,脐带,心脏等,如果没有你可以不必担心,以后复查侧脑室不继续大起来就不要紧! 参考技术A 想写游戏自走路工具冒险岛网找东西知道向键模拟总效没办麻烦知道说弄~用winio组件 驱级模拟向键
winio 驱动程序加载失败
开始用WINIO的时候还能正常运行,突然就加载失败了!!!后来无论从新下3个文件,从启动电脑,都提示驱动程序加载失败!!!是否有什么注册之类的?大虾们来帮帮忙呀~~~~
'模块-----------
Public Declare Function MapPhysToLin Lib "WinIo.dll" (ByVal PhysAddr As Long, ByVal PhysSize As Long, ByRef PhysMemHandle) As Long
Public Declare Function UnmapPhysicalMemory Lib "WinIo.dll" (ByVal PhysMemHandle, ByVal LinAddr) As Boolean
Public Declare Function GetPhysLong Lib "WinIo.dll" (ByVal PhysAddr As Long, ByRef PhysVal As Long) As Boolean
Public Declare Function SetPhysLong Lib "WinIo.dll" (ByVal PhysAddr As Long, ByVal PhysVal As Long) As Boolean
Public Declare Function GetPortVal Lib "WinIo.dll" (ByVal PortAddr As Integer, ByRef PortVal As Long, ByVal bSize As Byte) As Boolean
Public Declare Function SetPortVal Lib "WinIo.dll" (ByVal PortAddr As Integer, ByVal PortVal As Long, ByVal bSize As Byte) As Boolean
Public Declare Function InitializeWinIo Lib "WinIo.dll" () As Boolean
Public Declare Function ShutdownWinIo Lib "WinIo.dll" () As Boolean
Public Declare Function InstallWinIoDriver Lib "WinIo.dll" (ByVal DriverPath As String, ByVal Mode As Integer) As Boolean
Public Declare Function RemoveWinIoDriver Lib "WinIo.dll" () As Boolean
Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Public Const KBC_KEY_CMD = &H64 '键盘命令端口
Public Const KBC_KEY_DATA = &H60 '键盘数据端口
Public Const VK_3 = &H33
'-----------------------------------以上是WIN32 API函数声明-----------------------------------------
Public Sub KBCWait4IBE() '等待键盘缓冲区为空
Dim dwVal As Long
Do
GetPortVal &H64, dwVal, 1
'这句表示从&H64端口读取一个字节并把读出的数据放到变量dwVal中
'GetPortVal函数的用法是GetPortVal 端口号,存放读出数据的变量,读入的长度
Loop While (dwVal And &H2)
End Sub
Public Sub MyKeyDown(ByVal vKeyCoad As Long)
'这个用来模拟按下键,参数vKeyCoad传入按键的虚拟码
Dim btScancode As Long
btScancode = MapVirtualKey(vKeyCoad, 0)
KBCWait4IBE '发送数据前应该先等待键盘缓冲区为空
SetPortVal KBC_KEY_CMD, &HD2, 1 '发送键盘写入命令
'SetPortVal函数用于向端口写入数据,它的用法是SetPortVal 端口号,欲写入的数据,写入数据的长度
KBCWait4IBE
SetPortVal KBC_KEY_DATA, btScancode, 1 '写入按键信息,按下键
End Sub
Public Sub MyKeyUp(ByVal vKeyCoad As Long)
'这个用来模拟释放键,参数vKeyCoad传入按键的虚拟码
Dim btScancode As Long
btScancode = MapVirtualKey(vKeyCoad, 0)
KBCWait4IBE '等待键盘缓冲区为空
SetPortVal KBC_KEY_CMD, &HD2, 1 '发送键盘写入命令
KBCWait4IBE
SetPortVal KBC_KEY_DATA, (btScancode Or &H80), 1 '写入按键信息,释放键
End Sub
部分省略--没法下不下了。~~~~~~~
Private Sub Form_Load()
If InitializeWinIo = False Then
MsgBox "驱动程序加载失败!"
Unload Me
End If
End Sub
DSE和PG。另外32位系统只能用32位驱动,64位系统只能用64位驱动
以上是关于vb加载winio驱动失败 下面是代码 希望哪位高人指点一下的主要内容,如果未能解决你的问题,请参考以下文章