Bradley1234,
The declaration should be:
[DllImport("inpout32.dll", EntryPoint="Out32")]
Not:
[DllImport{"inpout32.dll", EntryPoint="Out32")]
Notice the bracket instead of the open parenthesis.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Thanks Nicholas,
I found one site so far,
http://www.codeproject.com/csharp/csppleds.asp
that claims a way to do this with their .dll (Im unable to copy text
from
the site) but when I entered their code verbatim? Errors,
using System.Runtime.InteropServices;
... windows generated form1 + declarations
public class portAccess
{
[DllImport{"inpout32.dll", EntryPoint="Out32")]
* *
// syntax error, "]" expected and "{" is invalid token, "=" invalid
token
public static extern void Output(int adress, int value);
}
There is no help available for "DllImport" or its syntax that I could find
"Nicholas Paldino [.NET/C# MVP]" <
[email protected]>
wrote
in
message Bradley1234,
AFAIK, there is nothing in .NET to access it. You might have to
actually use CreateFileEx and pass LPT1 (assuming your printer is
connected
to that) in order to write to the printer port (there might also be a
more
elegant way, but I am not sure).
However, you will most likely have to access the API in order to
read/write bits directly to the printer attached to a port.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
What is the way to send/read bits to the printer port at the hex
3F8-3FF
or
any other legacy io space??
Does C# include the methods to drive the printer or other ports?
tia