471,356 Members | 1,636 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

Printers and parallel ports

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.
Jul 21 '05 #1
0 1072

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Joseph Suprenant | last post: by
11 posts views Thread by karan | last post: by
1 post views Thread by Kevin | last post: by
reply views Thread by Diego Solis | last post: by
11 posts views Thread by Isaac T Alston | last post: by
1 post views Thread by cddeboer | last post: by
11 posts views Thread by Timothy Smith | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.