Board index » delphi » With BPW 7.0, how to Exec another program?

With BPW 7.0, how to Exec another program?

The function Exec is available from within a DOS-compiled  .PAS-program,
for example:
  exec('c:\myprog.exe', params);
But Exec is defined only for Real and Protected compiles. How do
you do this with Windows?
 

Re:With BPW 7.0, how to Exec another program?


Hi,

Quote
Peter Rooney wrote:
> The function Exec is available from within a DOS-compiled  .PAS-program,
> for example:
>   exec('c:\myprog.exe', params);
> But Exec is defined only for Real and Protected compiles. How do
> you do this with Windows?

From the Windows unit: LoadModule or WinExec.

 - Sebastian

Re:With BPW 7.0, how to Exec another program?


"Peter Rooney" <magne...@ix.netcom.com> schrieb im Newsbeitrag
news:8s65gu$aco$1@nntp9.atl.mindspring.net...

Quote
> The function Exec is available from within a DOS-compiled  .PAS-program,
> for example:
>   exec('c:\myprog.exe', params);
> But Exec is defined only for Real and Protected compiles. How do
> you do this with Windows?

In windows, you have the problem of whether or not wait until the program
you called has exit. So there are _two_ Win16 functions:

WinExec
and
WinExecWait

(in 32-Bit environments, you would use CreateProcess, but it is not defined
in Win16).

For further reference, look at the online help for WinExec, WinExecWait and
the SW_XXX constants (for hiding, maximizing etc. the new program window).

--
Rudolf Polzer
REBOUNCE - http://www.mycgiserver.com/~rebounce
I wish I was what I was when I wished I was what I am now.

Re:With BPW 7.0, how to Exec another program?


JRS:  In article <8s65gu$ac...@nntp9.atl.mindspring.net> of Fri, 13 Oct
2000 01:10:33 seen in news:comp.lang.pascal.borland, Peter Rooney

Quote
<magne...@ix.netcom.com> wrote:
>The function Exec is available from within a DOS-compiled  .PAS-program,
>for example:
>  exec('c:\myprog.exe', params);
>But Exec is defined only for Real and Protected compiles. How do
>you do this with Windows?

Have you considered the online Help for WinExec?

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

Other Threads