Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

Spawning program does not complete correctly

I've written an DOS application in MSVC 1.52.
It executes PKZIP and PKUNZIP a number of times.  But one  call always appears to hang.  I've executed the command directly from the command line rather than from my application and it works correctly.  I'm using _spawnl( _P_WAIT, ...) and checking for any error returned from the call.

Could it be a memory allocation problem? complier/linker setting? or does anyone have any idea how to solve this problem.

Thanks in advance,

Gary
0
garywilkinson
Asked:
garywilkinson
1 Solution
 
alexoCommented:
>> Could it be a memory allocation problem?
Possibly.  DOS has a limited memory pool and both your program and PKZIP must fit in free memoty.

>> does anyone have any idea how to solve this problem.
Try fiddling with PKZIP "troubleshooting" options:

    -3     Disable 32-bit instruction usage on 80386 or higher CPU's
    -^      Echo the command line
    -+     Disable Expanded Memory (EMS) usage
    --      Disable UMB/HMA Memory (XMS) usage
    -~     Disable Network usage
    -)      Disable 32 bit DPMI usage
    -(      Use "Slow" MemCopy

0
 
AlexVirochovskyCommented:
I think, that is memory problem . After some time working of
programm in memory are "leeps" and no large size of free
memory for pkzip. Solution: close all files, make free all
dinamic alloc of memory, make pkzip/pkunzip , open all
files ...
Regards, Alex
0
 
Darren_SimonsCommented:
I wonder if this is similar to a known problem with install kits. Using eg. InstallShield, if you want to execute another install program you often do not get control back at the end of the called program's execution - ISTR a workaround for that on the InstallShield website (support.installshield.com). You might be able to tailor that to your problem.

Darren

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
MithanderCommented:
I'm not sure what the '_spawnl( _P_WAIT, ...)' command does.  But the thing that first comes to mind is that it waits for an error it never gets, so it just sits there.  I don't know though.  Maybe it will help point you in the write direction.
0
 
rbrCommented:
Can you post some piece of your code pls!
0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
AlexVirochovskyCommented:
You can tray use batch file and use "exec" command.
You batch file may be static(with you system) or
dinamic: create , use, delete
0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
garywilkinsonAuthor Commented:
I have managed a work-around by creating multiple zip files and unzipping seperately rather than creating just one zip file for all my files.  I would still like to know if it is possible to create just one zip file by doing things differently.

The code I'm using is as follows:
if (_spawnl( _P_WAIT, "D:\\PKUNZIP.EXE", "PKUNZIP", "-o", "D:\\JDWE441A.ZIP", "D:\\", NULL) < 0)

0
 
sergelebelCommented:
<try this>  write another program using the same calling as your existing program...but keep it as small as possible to use very little memory...this will confirm that your problem is indeed memory related..(which I think it is) .. another suggestion would be to look into another Zip program which uses less memory or upper memory..!  
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now