473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 1135

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joseph Suprenant | last post by:
I am looking to read a byte or write a byte on the parallel port in linux. I am using red hat 7.3. I tired using this but i couldnt get anywere. { unsigned char value; __asm__ volatile ("inb...
11
by: karan | last post by:
I would like to know how one can use the parallel port through c/c++.Also, how does one determine what port is installed(EPP/ECP/SSP/PS2)? What is the differnece between these? What are the...
1
by: Kevin | last post by:
Hi All, I am fairly new to C#, but I do have Programming experience in VB, and the best way to learn C# is by doing, so I want to create an application that can monitor printers connected to my...
3
by: Dave | last post by:
Im just starting in vb6 and want to write a scanning program, but iam being flumoxed by the use of and access to parallel ports. Can anyone help? please Thanks Dave
0
by: Diego Solis | last post by:
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...
11
by: Isaac T Alston | last post by:
Basically, I'm thinking about building a robot which can be controlled by programs which I write, I'm going to interface to the robot through the parallel port (like in this tutorial here:...
1
by: cddeboer | last post by:
I am using MS-Access XP and am using the following syntax Set Application.Printer = Application.Printers("PrinterName") to change the default printer. Then when I go to check the associated...
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.