Dustylozen
asked on
Parallel port I/O
Can I use parport.sys to send and receive data by writing a driver with visual basic.net?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I can study this and get started.
ASKER
lewisg, VC++ express fails to upgrade the code when I try to load it.
Inpout32.dll is a dynamically linked library. You don't load it in the programming IDE you first declare and then call it from your code. Something like this:
first the declares:
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)
Public Declare Function Inp32 Lib "DllPort.dll" (ByVal PortAddress As Integer) As Integer
then an output call:
Out (Val("&H378"), Val(D))
In your question you refer to visual basic.net but now you comment about using VC++ express. These are two different programming languages. I'm fairly sure Inpout32.dll will work in either but the syntax will be different.
Here is a fairly decent tutorial on how to use inpout32.dll in VB 2005 Express Edition:
http://www.codeproject.com/KB/vb/Inpout32_read.aspx
Test code for various programming languages can be found here:
http://www.hytherion.com/beattidp/comput/pport.htm
To be more specific I will need to know exactly what you are trying to accomplish and what IDE you are using.
first the declares:
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)
Public Declare Function Inp32 Lib "DllPort.dll" (ByVal PortAddress As Integer) As Integer
then an output call:
Out (Val("&H378"), Val(D))
In your question you refer to visual basic.net but now you comment about using VC++ express. These are two different programming languages. I'm fairly sure Inpout32.dll will work in either but the syntax will be different.
Here is a fairly decent tutorial on how to use inpout32.dll in VB 2005 Express Edition:
http://www.codeproject.com/KB/vb/Inpout32_read.aspx
Test code for various programming languages can be found here:
http://www.hytherion.com/beattidp/comput/pport.htm
To be more specific I will need to know exactly what you are trying to accomplish and what IDE you are using.
ASKER
I used this information along with the other solution to get a working answer.
ASKER
lewisg:
I figured that out by looking at several examples. I had the error " unable to load inpout.dll " on the VB example until I put the full path in the Declare statement.
Thanks much
I figured that out by looking at several examples. I had the error " unable to load inpout.dll " on the VB example until I put the full path in the Declare statement.
Thanks much
"until I put the full path in the Declare statement. "
The other things that usually work are:
1. Put the DLL in the windows\system directory and register the file with something like:
regsvr32 c:\windows\system\inpout32 .dll
2. Use the app.path or it's equivalent in the declare statement.
http://forums.devx.com/showthread.php?t=148101
The other things that usually work are:
1. Put the DLL in the windows\system directory and register the file with something like:
regsvr32 c:\windows\system\inpout32
2. Use the app.path or it's equivalent in the declare statement.
http://forums.devx.com/showthread.php?t=148101
http://webcache.googleusercontent.com/search?q=cache:vDVdsmtO6Y4J:www.mattjustice.com/parport/par_vb.html+%22visual+basic%22+parport.sys