Mail Archives: djgpp/1998/05/22/22:45:30
From: | "Sergi Marsal" <smarsal AT abonados DOT cplus DOT es>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | print in djgpp
|
Date: | Thu, 21 May 1998 21:25:13 +0200
|
Organization: | Telefonica Transmision de Datos
|
Lines: | 36
|
Message-ID: | <6k1ut6$4gn$2@talia.mad.ibernet.es>
|
NNTP-Posting-Host: | abonado-195-53-36-128.cat.es
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I have a problem when I try to detect when is the printer available por
printing, I know it can be done because in other programming languages like
clipper I can test it before printing, but I don't know how to do it in
DJGPP
in C the code is like this
#include <stdio.h>
int main(void)
{
FILE *prn;
if ((prn=fopen("prn", "w"))==NULL)
{
printf("Printer not available");
}
else
{
printf("Printer available");
}
return 1;
}
but in DJGPP doen't work...
the "prn" file I try to open is the name of the printer device in DOS and I
have to open it for write only, but I tried other ways (read/write, etc)
if anyone know of other ways to do it (interrupts, ports, whatever), please
tell me. I need it for my school project.
thanks everyone for reading this message
- Raw text -