Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!boulder!ccncsu!longs.LANCE.ColoState.Edu!gs940971 From: gs940971@longs.LANCE.ColoState.Edu (glen sunada f84) Newsgroups: comp.sys.ibm.pc Subject: Re: HELP! Using DOS print Message-ID: <3289@ccncsu.ColoState.EDU> Date: 29 Nov 89 04:58:08 GMT References: <6534@brspyr1.BRS.Com> Sender: news@ccncsu.ColoState.EDU Reply-To: gs940971@longs.LANCE.ColoState.Edu (glen sunada f84) Distribution: usa Organization: Colorado State U. Center for Computer Assisted Engineering Lines: 35 In article <6534@brspyr1.BRS.Com>, jillj@brspyr1.BRS.Com (Jill Jacomine) writes: > I am trying to execute the DOS (version 3.1) print command from within > an executable (compliled using MSC 5.1). The command I am using is: > > spawnvp(P_WAIT,"print.com",args); [deleted stuff] > within the program eats up about 200k of memory, and never lets it go. > (I tried setting the device before executing the program, and it seems > to work fine, therefore I am relativly sure the problem is with the > /D:prn option). A chkdsk before running the program shows 655360 bytes [deleted stuff] > I have tried using the SYSTEM function, as well as different SPAWN > functions, but they all yield the same results. Has anyone else come > across this problem, or can anyone offer information as to why this > happens and how it can be corrected. The problem is that the DOS print command is not just a file printer but also a siak based print sppooler and scheduler (sp?). To correctly spool and schedule jobs print needs to make part of its code resident. Print uses some mechanism to detect if it is already resident to prevent multiple copies of the resident code. I do not know how this is done but one way may be to check trough the interrupt linkages and see if print is there (I think i saw somewhere that print preempts one of the user interrupts for communication to the resedent code but I can no prove this). The best solution is to write your own printout routine in your program. If the progam is to be used in house only then just make sure that the print command has always been installed before running your program. Glen U. Sunada gs940971@longs.LANCE.ColoState.EDU ARPA Internet (preferred) ...!ncar!boulder!ccncsu!longs.LANCE.ColoState.EDU!gs940971 UUCP We have only ignorence to fear