T.R | Title | User | Personal Name | Date | Lines |
---|
3138.1 | ? | WJG::GUINEAU | Quantum Reality | Wed Nov 22 1989 08:13 | 12 |
| > Does anyone have an example of how to load/mount the printer
> device driver from a program? If not, how about a narative
> on how it is done?
I believe the printer driver will be loaded upon reference to it (device PRT:).
What are you trying to do?
You can execute any DOS command via the Execute() function.
John
|
3138.2 | More info | KYOA::MIANO | I'm outta that place!!!! | Wed Nov 22 1989 10:28 | 15 |
| If I reboot the system and run a program that has
fopen( "PRT:", "w+" )
the program just hangs or if I do
a copy XYX PRT: the same thing happens.
(At this point I can see printer.device is not loaded.)
If I do a "printfiles" first then run the program it works fine.
After doing this I can see printer.device is loaded.
I was wondering how to do what printfiles is doing to load the device
in a program.
John
|
3138.3 | ? | WJG::GUINEAU | Quantum Reality | Wed Nov 22 1989 11:17 | 15 |
|
This all seems strange (to me anyway). I just booted my system, and typed
1> copy small-text-file PRT:
And it printed. Maybe you don't have your printer properly
set up in preferences?
Maybe c's fopen(0 is causing trouble. Have you tried the AmigaDOS Open()
function?
I guess you could try doing an OpenDevice() on printer.device and usinf Exec
I/O on it...
John
|
3138.4 | Why is my memory so feable??? ;-= | FROCKY::BALZER | Christian Balzer DTN:785-1029 | Thu Nov 23 1989 04:29 | 10 |
| I ran into this one a loooong time ago, too. It was something very
trivial but unfortunately I can't remember right now. But I still
have the example program at home, so if you could wait until Monday...
The fopen() vs. Open() thing seems to ring a bell...
And the loading of the printer.device IS done automagically, IF
called in the _right_ way. ;-)
Regards,
<CB>
|
3138.5 | | NBOIS2::FRIES | | Thu Nov 23 1989 04:32 | 6 |
| I had the same problems some months ago.
One reason: The printer was simply OFFLINE
Second reason: I took the 1.3printer-driver but 1.2printer.device
gerald
|
3138.6 | it works in Marlboro | WJG::GUINEAU | Quantum Reality | Thu Nov 23 1989 09:16 | 36 |
|
I just booted my Amiga, typed 1> show -d (my show exec list program) and saw
that neither the PRINTER.DEVICE nor the PARALLEL.DEVICE was loaded
I then ran the following simple program which printed a line on the printer.
Again I typed 1> show -d and saw that both the PRINTER.DEVICE and
PARALLEL.DEVICE were now loaded.
I am using fopen("PRT:","w") newfile mode "w" and not append mode "w+". This
may make a difference since append expects a file to already be there (which
PRT: would not be until after the first access).
John
#include <stdio.h>
void main(int argc, char *argv[])
{
FILE *fp;
fp = fopen("prt:","w");
if(!fp) {
printf("can't open PRT:\n");
exit(
);
fprintf(fp,"Test Line\n");
fclose(fp);
exit(0);
}
|
3138.7 | and on the other side of the globe, too. ;-) | FROCKY::BALZER | Christian Balzer DTN:785-1029 | Mon Nov 27 1989 03:44 | 12 |
| Re: .6
He John,
you've beat me to it. And since my demo source looks pretty identical,
I'll save me the time to upload it.
Like I said, it just happens automagically (actually it's the soon
to be dead ramlib.library that get's those devices for ya).
Regards,
<CB>
|