×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

"Program too big" error when shelling in XP

"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?

RE: "Program too big" error when shelling in XP

Try this.
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

(OP)
Thanks Buff1, but I was hoping to have a single executable as this program will be set up on multiple computers, so I wanted as simple an installation as possible.  Late last night I found an acceptable solution.  A problem with XP and QuickBasic is that QuickBasic cannot perform the following:

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

You are interfacing windows programs, so why don't you switch to Visual Basic Script?
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close