Solved

Spawning program does not complete correctly

Posted on 1998-11-09
11
196 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
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

770 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