Hi people,
I need to write a C# program which communicates with a thermal printer.
After a search for the web I found that a way to comunicate with the ports
is calling the kernel32.dll, which has some external methods (CreateFile,
WriteFile, ReadFile, Get/Set CommSettings, Get / Set CommTimeOuts) to
communicate with the port.
My first problems with this dll is that I couldn't find the right
settings to send data to the port ( only exception I got, maybe configure
that is harder than I thought) and the second problem is that I can't use the
dll's readFile method with the parallel port (:S).
Don't worry, jejeje, I found an alternative way to read and write the
parallel port: another dll called inpout32.dll which has 2 external methods
only: Output (write the port) and Input (read the file). My problem with this
is the following (I'll describe an example): If I try to send a command with
hexadecimal code 0x05 to my printer (parallel) which must return me a byte
status, and I read after the write I read the same thing that I write. If I
send other hexadecimals commands to my printer no action is taken and I read
the last hexadecimal code that I write.
What is my problem? I'm using wrong the dlls? Can somebody help me?
Thanks for the support.