Solved

Spawning program does not complete correctly

Posted on 1998-11-09
11
200 Views
Last Modified: 2010-04-15
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
Comment
Question by:garywilkinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1254105
>> 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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1254106
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
 
LVL 1

Expert Comment

by:Darren_Simons
ID: 1254107
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
Independent Software Vendors: 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!

 

Expert Comment

by:Mithander
ID: 1254108
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
 
LVL 10

Accepted Solution

by:
rbr earned 100 total points
ID: 1254109
Can you post some piece of your code pls!
0
 

Author Comment

by:garywilkinson
ID: 1254110
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1254111
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
 

Author Comment

by:garywilkinson
ID: 1254112
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
 

Author Comment

by:garywilkinson
ID: 1254113
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
 

Author Comment

by:garywilkinson
ID: 1254114
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
 
LVL 1

Expert Comment

by:sergelebel
ID: 1254115
<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

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question