[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

3138.0. "Loading the Printer Device?" by KYOA::MIANO (I'm outta that place!!!!) Wed Nov 22 1989 01:28

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?

John
T.RTitleUserPersonal
Name
DateLines
3138.1?WJG::GUINEAUQuantum RealityWed Nov 22 1989 11:1312
> 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.2More infoKYOA::MIANOI'm outta that place!!!!Wed Nov 22 1989 13:2815
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::GUINEAUQuantum RealityWed Nov 22 1989 14:1715
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.4Why is my memory so feable??? ;-=FROCKY::BALZERChristian Balzer DTN:785-1029Thu Nov 23 1989 07:2910
    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.5NBOIS2::FRIESThu Nov 23 1989 07:326
    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.6it works in MarlboroWJG::GUINEAUQuantum RealityThu Nov 23 1989 12:1636
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.7and on the other side of the globe, too. ;-)FROCKY::BALZERChristian Balzer DTN:785-1029Mon Nov 27 1989 06:4412
    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>