"Program too big" error when shelling in XP
"Program too big" error when shelling in XP
(OP)
I have a problem. I wrote a program using QB4.5 to take a file created by a DOS program, print it to a postscript file, and then pass it to ghostscript (v8.13 or v8.15) to convert it to a pdf, then launch the default viewer. The program works great under Win98se, but is having problems under XP. I have resolved the issues with the launch of the pdf (START command) and some issues with shelling to batch files (using cmd /c), but the problem I am having right now is when I try to run ghostscript from the batch file in a shell. I am getting a "Program too big to fit in memory" error. I have tried playing with the memory settings for the pif and have stripped the autoexec.nt and config.nt file to maximize available memory. I even put the "mem /c" command in the batch file prior to running ghostscript and verified that the available memory is about the same between Win98se and XP. I am able to shell other programs without error, but can't seem to get ghostscript to run in the shell. (Yes, I tried to run the batchfile external from my program and it ran ok.)
Any suggestions as to what I can try next?
Any suggestions as to what I can try next?
RE: "Program too big" error when shelling in XP
Start QB with a batch file that includes a call to another bat file.
i.e.
@echo off
cd\qb45
call myprog.exe
call X.bat
-----------
in myprog, open x.bat for output and put whatever you want
in it, close it, then exit the program. the original bat file should run x.bat which should save some memory.
Another trick is to make a small program with just the
shell statement shell "whatever.exe"
and chain the that smaller program (this will not save as
much as the other way but I have found it usefull).
RE: "Program too big" error when shelling in XP
SHELL "START file.pdf"
QuickBasic is unable to use the START command as it is a system command and not a program. QuickBasic is able to perform other DOS internal commands, but is unable to directly execute the START command. For this reason, I have done as you mentioned, created a batchfile from within the main program to run the offending "memory-hog" from a batch file as well as handle the temp file cleanup. To execute this batchfile in it's own window with a fresh memory model, I used the following statement:
SHELL "cmd /c START filename.bat"
This will shell to cmd, execute the START command which will open a new window and execute filename.bat. This has solved the memory issue as well as keeping everything in one executable.
RE: "Program too big" error when shelling in XP
No memory problems, you can START whatever you want, even interface with a batch file if you need to do it..
The syntax is not so different from QB, and you have it in every version of windows from W98 (you can download it for older Windows).
Antoni
http://www.geocities.com/antonigual/index.html