Printers and parallel ports
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
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.
.
Relevant Pages
- RS232 Problem
... I have a program that communicates with an instrument via the RS232 interface. ... If I go into the Device Manager and disable and then re-enable the port, ... My customer has a recent WinXP computer that runs an earlier version of the program, but not the latest versions, giving my "communications failure" response when it tries to receive data. ... The ports are running at 9600 baud for one program and 19600 baud for another. ... (microsoft.public.windowsxp.basics) - find com port mapped to USB
... I need to write a PC program that communicates with a small device that have ... Firmware guy showed me that the device can initialize its USB port, ... if the device started its USB port setup successfully. ... (microsoft.public.vc.mfc) - Re: find com port mapped to USB
... >I need to write a PC program that communicates with a small device that have ... >a USB port in it. ... >Firmware guy showed me that the device can initialize its USB port, ... the user specify the COM port in a config file. ... (microsoft.public.vc.mfc) - Client port for SQL
... I'm running a vb.net Windows application that communicates with a SQL Server ... How do I specify the port on the client that should be used for this ... I have a customer that would like the client application to use port 80 so ... (microsoft.public.dotnet.languages.vb) - Re: printer not printing
... It appears to send the order to the desktop computer, but it just lands in a queue and doesn't print. ... Is there a document showing in queue after clicking on Test Page, and does it eventually go away, or do you have to manually clear the queue? ... I did some troubleshooting through HP Help, and at this point it suggests using another printer port if there is one (I don't think there's another parallel port on this computer) or uninstalling the port and letting Windows reinstall it. ... (microsoft.public.windowsxp.hardware) |
|