launching an .EXE from pascal? 
Author Message
 launching an .EXE from pascal?

can someone help me figure out how to launch an .EXE from a Pascal
program and terminate the current application?

i'm using some sound and graphics libraries that require application
shutdown to flush memory, and i want to have the program be able to
switch libraries without the user having to exit and restart.  is this
feasible?

thanks,

-tim



Wed, 18 Jun 1902 08:00:00 GMT  
 launching an .EXE from pascal?


Quote:
>can someone help me figure out how to launch an .EXE from a pascal
>program and terminate the current application?

>i'm using some sound and graphics libraries that require application
>shutdown to flush memory, and i want to have the program be able to
>switch libraries without the user having to exit and restart.  is this
>feasible?

How about using BAT-files?

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 launching an .EXE from pascal?

Quote:



> >can someone help me figure out how to launch an .EXE from a pascal
> >program and terminate the current application?

> How about using BAT-files?

i thought about that, but it's not very elegant.  i was hoping for
something that was more aesthetic from the user's point-of-view.

i tried doing:

swapvectors;
exec('COMMAND.COM','/C FILE.EXE');
swapvectors;

(thanks MK)

but it does nothing for some reason, whereas elsewhere in the code i do a:

  swapvectors;
  exec(fsearch('start.exe',getenv('path')),'http://www.speedstrip.com');
  writeln(doserror);
  swapvectors;

to launch a browser to my web page, which works fine.

any pascal sleuths out there know how to do it?

thanks,

tim



Wed, 18 Jun 1902 08:00:00 GMT  
 launching an .EXE from pascal?
If your program is in real mode then use the chain utility from
Turbopower Software. It can be found at:

ftp://ftp.turbopower.com/pub/misc/funcs/chain.lzh

If you happen to find a way to do it in protected mode let me know.
Martin.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Wed, 18 Jun 1902 08:00:00 GMT  
 launching an .EXE from pascal?


Quote:




>> >can someone help me figure out how to launch an .EXE from a pascal
>> >program and terminate the current application?

>> How about using BAT-files?

>i thought about that, but it's not very elegant.

Why is it nor elegant? One uses the tool that is designed for the
purpose.

Quote:
> i was hoping for
>something that was more aesthetic from the user's point-of-view.

The user does not have to care if it is a BAT-file or not.

Quote:
>i tried doing:

>swapvectors;
>exec('COMMAND.COM','/C FILE.EXE');
>swapvectors;

>(thanks MK)

>but it does nothing for some reason, whereas elsewhere in the code i do a:

>  swapvectors;
>  exec(fsearch('start.exe',getenv('path')),'http://www.speedstrip.com');
>  writeln(doserror);
>  swapvectors;

>to launch a browser to my web page, which works fine.

Exec always needs the full path as first parameter. The second is just
parameters for the program. You can write any command line after the
"/C" (no need to put any extensions etc.)

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 launching an .EXE from pascal?
Tim,
  There are two ways that I currently launch programs. When the programs to be
run may vary over time I use a menu program that runs innside a BATch file.
The user never sees that it is a batch file because I run a program which
displays a nice menu on the screen. Using either keyboard or mouse, the user
selects the program they want and the program exits with a corresponding Dos
Error Code. The batch file then runs the chosen program. This method leaves
the most memory available for the called program.

  The second way involves the EXEC command. This example is from a working
program:

 command := ' /C ' + prog_name + ' ' + divsn + ' ' + dvsn_name ;
  prog_name := 'c:\command.com' ;
  SwapVectors;
  Exec(prog_name,Command) ;
  SwapVectors;

It is very important though to do this from a small program which has the
folloing line in it:

{$M $2000, 0, 0 }  { 16K Stack, No Heap }

I put this right after my USES section. Expiriment with the Stack & Heap
values so you can use the smallest values possible. The more memory you use
here, the less your program will have.

I hope this helps.

Val M.

Quote:




> > >can someone help me figure out how to launch an .EXE from a pascal
> > >program and terminate the current application?

> > How about using BAT-files?

> i thought about that, but it's not very elegant.  i was hoping for
> something that was more aesthetic from the user's point-of-view.

> i tried doing:

> swapvectors;
> exec('COMMAND.COM','/C FILE.EXE');
> swapvectors;

> (thanks MK)

> but it does nothing for some reason, whereas elsewhere in the code i do a:

>   swapvectors;
>   exec(fsearch('start.exe',getenv('path')),'http://www.speedstrip.com');
>   writeln(doserror);
>   swapvectors;

> to launch a browser to my web page, which works fine.

> any pascal sleuths out there know how to do it?

> thanks,

> tim



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

 Relevant Pages 

1. TPX.EXE AND TURBO.EXE {difference between}

2. TPX.EXE and TURBO.EXE

3. Windows EXE and DOS EXE

4. EXE to PAS or EXE to C\c++ ?

5. Appending exe to exe file

6. an exe form an exe

7. Tlink.exe - Tasm.exe .....

8. fc TURBO.EXE TPX.EXE /b

9. HELP: Launching a Windows Application from Delphi v2.0

10. launch question

11. Launching

12. System Calls (Launching an App)

 

 
Powered by phpBB® Forum Software