Cita de: kakinets en 1 Noviembre 2008, 16:12 PM
logre instalar ahora tengo un problema y no se si es por el window vista...CitarBuen dia estuve leyendo un manual sobre VB en este sitio eh hice todo como dicen ahi entendi todo pero tengo problemas cuando apreto el Boton me tira un error y me deja de fucionar la aplicacion... Aclaro q tengo Windows Vista Ultimate 32 Bits
este es el codigo q utilice:
Module 1
Código:
Public Declare Function Inp Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Formulario
Código:
Private Sub Command1_Click()
Out &H378, 255
End Sub
Private Sub Command2_Click()
Out &H378, 1
End Sub
Private Sub Command2_Click()
Out &H378,
End Sub
la entrada y salida es 0378 - 037F
Este es el error q me da:
Si alguien tiene la solucion aeste problema... ya prove de todo busque de todo...
Probe un ejemplo en C y anda así q es problema del Visual o de mi q estoy pifiando en algo....
Todos los ejemplo q bja en Visual me de el mismo error....
que estas haciendo que utilize el puerto paralelo?
en todo caso usa otra dll, y no el inpout32.dll que de pedo funciona en xp, y en vista dudo totalmente que funcione...
edit: aca encontre lo que uso yo para escribir el puerto paralelo, fijate es una dll y un modulo.
Module1:
Código (vb) [Seleccionar]
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
'********************************************************
'********* Function Descriptions *******************
'********************************************************
'PortOut - Outputs a byte to the specified port.
'PortWordOut - Outputs a word (16-bits) to the specified port.
'PortDWordOut - Outputs a double word (32-bits) to the specified port.
'PortIn - Reads a byte from the specified port.
'PortWordIn - Reads a word (16-bits) from the specified port.
'PortDWordIn - Reads a double word (32-bits) from the specified port.
'SetPortBit - Sets the bit of the specified port.
'ClrPortBit - Clears the bit of the specified port.
'NotPortBit - Nots (inverts) the bit of the specified port.
'GetPortBit - Returns the state of the specified bit.
'RightPortShift - Shifts the specified port to the right. The LSB is
' returned, and the value passed becomes the MSB.
'LeftPortShift - Shifts the specified port to the left. The MSB is
' returned, and the value passed becomes the LSB.
'IsDriverInstalled - Returns non-zero if io.dll is installed and
' functioning. The primary purpose of this function
' is to ensure that the kernel mode driver for
' NT/2000/XP has been installed and is accessible.
el puerto se lo pasas como &H378, igual que en tu caso
http://santiagohssl.googlepages.com/io.dll
saludos