" exec " in protect mode with BP7.0 
Author Message
 " exec " in protect mode with BP7.0

Dear all:
    I am trying to run a .exe file from within BP7.0 program in
protected mode , using "exec" . I've got error when I run it.
But when I run it in real mode, the program is fine.  Can anyone
care to explain it ?

Thanks for your help!
Gavin.

program exe_dos;

{$M 2048,0,0}
uses dos;
var
     progname,
     cmdline    : string;

begin

     progname := ' c:\pkunzip.exe';
     cmdlin := ' -o c:\test.zip';
     swapvectors;
     exec(progname, cmdlin);
     swpavectors;

end.



Wed, 18 Jun 1902 08:00:00 GMT  
 " exec " in protect mode with BP7.0

Quote:

>Dear all:
>    I am trying to run a .exe file from within BP7.0 program in
>protected mode , using "exec" . I've got error when I run it.
>But when I run it in real mode, the program is fine.  Can anyone
>care to explain it ?

>Thanks for your help!
>Gavin.

>program exe_dos;

>{$M 2048,0,0}
>uses dos;
>var
>     progname,
>     cmdline        : string;

            ?

Quote:
>begin

>     progname := ' c:\pkunzip.exe';
>     cmdlin := ' -o c:\test.zip';
>     swapvectors;
>     exec(progname, cmdlin);
>     swpavectors;
        ?

>end.

What is the purpose of the space at the beginning of the program name.
Lose it works.

Remember to check DOSerror always after EXEC().

Osmo

- Show quoted text -



Wed, 18 Jun 1902 08:00:00 GMT  
 " exec " in protect mode with BP7.0

Quote:

>     I am trying to run a .exe file from within BP7.0 program in
> protected mode , using "exec" . I've got error when I run it.
> But when I run it in real mode, the program is fine.  Can anyone
> care to explain it ?

I tried that myself (but w/o swapvectors()) and it works fine.
May be you should try out the 7.01 update for the BP 7.0. I have it installed.

Good Luck
Alexei A. Founze



Wed, 18 Jun 1902 08:00:00 GMT  
 " exec " in protect mode with BP7.0
Quote:
>Remember to check DOSerror always after EXEC().

>Osmo

Dear All:

   I've improved the program as below,I must execute it in DOS
protected mode and I can't get any Doserror code, but I got
error message after unzip the .zip file.
The error message as
         "Unhandled exception 000d at 0020 02f2 ErrCode 4400
          Unhandled exception 000d at 0020 02f2 ErrCode 0020"
I think this problem cause by memory manager. Because when
I execute it under DOS real mode or WinDOS, I didn't get any problem.
So, could anyone care to explain it ?

Thanks for your help!

Gavin

program test;

{$m 2048,0,0}
uses dos;
var
   comm : string;
begin

     comm := 'c:\pkunzip.exe -o c:\test.zip';
     swapvectors;
     exec(getenv('comspec'),'/c'+comm );
     swapvectors;
     if doserror <> 0 then
        writeln('dos error number from' + Getenv('compsec'),Doserror)
     else
        writeln('mission accomplished,exit code',DosexitCode);

end.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. "exec" in DOS protected mode with BP7.0

2. The keys "-"/"+"/"*"

3. ""256 Color Mouse""

4. What is "protected" in protected mode?

5. Exec in Protect Mode

6. DOS Exec from protect mode

7. Error "data segment too large" when compiling ind DOS protected mode

8. Error "data segment too large" when compiling ind DOS protected mode]

9. Error "invalid device driver" when using GRAPH unit in protected mode

10. Q: How to read the keyboard's state in "protected mode" (BP 7.0)

11. "too many files open" & protected mode

12. What is a "Pointer" in protected mode?

 

 
Powered by phpBB® Forum Software