hardware interface dll invalid
I am attempting to write some interface code for a piece of hardware. Because the hardware requires use of 12 control lines, I believe the parallel port is the easiest connection method. After some research, I have discovered that inpout32.dll is the most efficient solution with only two commands to worry about (inp32() and out32()). I have downloaded the dll and attempted to place it in my code using both dim and declare statements. The file resides in the root level of the project folder as well as another copy in the windows directory. No matter how I try to call the dll it gives me errors stating that libraries were expected and that the dll does not exist.
Any ideas?
Thanks in advance
Re: hardware interface dll invalid
Hey.
Next time post the functions definitions, i had to go search for them.
Anyhow you need API and you must do this:
Code:
Imports System.Runtime.InteropServices
Public class '......etc
<DllImport("inpout32.dll", EntryPoint:="Out32")> _
Public Shared sub Out _
(ByVal address As Integer, ByVal value As Integer)
End Function
<DllImport("inpout32.dll", EntryPoint:="Inp32")> _
Public Shared Function [In] _
(ByVal address As Integer) as Integer
End Function
Now i don't know if this will work but it will see the dll.Note you have to copy the dll in windows\system32 folder and another note that if you are using 64bit system it will fail and you probably have to search for a 64bit version of the dll.
Re: hardware interface dll invalid
I am confused as to what exactly what you wanted me to provide in the original post...
I think I can follow what you posted but I am confused as to what I am calling after the functions are defined in this manner. Am I calling the function [out]_? If this is correct, where do I put the data to be handled by the function.
Re: hardware interface dll invalid
Err.Yes well didn't you have a dll function structure? Even if it was C language?
This dll is quite popular as i see but if it was another dll where was i suppose to find out the declarations so i can convert them to vb?
Anyhow, yes you will use p.e. Out(800,55) or dim i as integer = [in](555).You can change the out and [in] with another name if you want.If they are confusing you.
Re: hardware interface dll invalid
thanks for the speedy reply, I will give this a try ASAP. I have a question though: because the machine I am working on does not have a parallel port, when I compile the program will it also include all dependencies i.e. inpout32.dll? Or will I manually have to copy this file?
Re: hardware interface dll invalid
If you mean creating a setup then you will have to include the dll.
Else, yes you must provide the dll also.