![]() |
Printer Port Programming
hi, I would just like to ask if any of you out there know how to program printer ports, I would like to know how to create a program that would allow me to access the printer and print, programming language to be used can be anything... tnx.... HOPE YOU COULD HELP ME....
|
Code:
int main(void) |
reply
um, i think your code will only work in a linux environment, im sorry i forget to include in my previos post that i need code that would be implemented in a windows environment, tnx, m sorry again
|
Standard printer (stdprn) is automatically opened when you include stdio.h (just like stdout, stdin ...).
|
reply 2 zekko:
um, could you explain what you just said, im not following you, i think what your talking about is the header files that can be used in c, could you please give me code to access the printer port so that i could print using a program or just provide me links to documents regarding this topic, tnx,,, hope you understand... |
Since u wanted to program in the windows probabbly vb u have go thorough some difficult tasks.If u definitely wnated i will let u know.But in C it is very easy.
printer port addresses are 0X378,379,37a the command in c is outportb(0X378,###) ###-value that u wanted to sent to the port in binary reading the value inportb(address) reads the particular add. if u want further details in c or vb contact me my mail is cmmfahim@yahoo.com I am an engineering graduate |
Since u wanted to program in the windows probabbly vb u have go thorough some difficult tasks.If u definitely wnated i will let u know.But in C it is very easy.
printer port addresses are 0X378,379,37a the command in c is outportb(0X378,###) ###-value that u wanted to sent to the port in binary reading the value inportb(address) reads the particular add. if u want further details in c or vb contact me my mail is cmmfahim@yahoo.com I am an engineering graduate If it is a priin ting program that u want ot print using the language i am not the one that u wanted |
Re: reply
Quote:
|
Code:
int main(void) { |
Re: reply ( post #8)
quote: -------------------------------------------------------------------------------- Originally posted by keikun_naruchan um, i think your code will only work in a linux environment, im sorry i forget to include in my previos post that i need code that would be implemented in a windows environment, tnx, m sorry again -------------------------------------------------------------------------------- Well yeah, this is linuxquestions.org you know reply: I know this is linuxquestions.org, but did you happen to understand what the general title of this forum is, it is NON-LINUX PROGRAMMING.. understand???? *****this is what is wriiten on the forums title***** Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game. |
reply to zekko:
WOW just few lines of code and it is already supposed to communicate with my printer and print.. tnx.. could you include the headers needed for this code to work, i understand that this code is in c++ or in c language am i right?, tnx again.. |
Oh I'm sorry, you need to include stdio.h
Code:
#include <stdio.h>One weird thing, it doesn't start printing until the program stops running (even if I fflush(stdprn)). I'm not sure why this is, could just be my printer. |
um, could you explain your code, what is stdprn and the sorts..
I would like to know what is within stdprn... its parameters and its functions... its quite advance programming for me.. tnx.. hope you still have patience with me... tnx again... reply: 4 zekko |
If you're learning from a book, it should teach how to work with files ... You'll learn how this all works once you get to there.
|
Quote:
You can download and compile winio32.dll (there are examples of using this .dll on the internet). by itsself then add the following files out of folder: These files: are needed for compiling with visual studio express 2008. Place "winio32.obj" "winio.h" in with project library and source files. Place the driver files out of dll folder with the source files "..\drv\winio_nt.h" you will have to change this to: "winio_nt.h" with source files in folder- unless you link to folder. Place winio32.dll and winio32.sys with binary. |
| All times are GMT -5. The time now is 09:56 PM. |