Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2007 May : Invoke an external program and get its i/o

www.cryer.info
Managed Newsgroup Archive

Invoke an external program and get its i/o

Subject:Invoke an external program and get its i/o
Posted by:"Anatoly" (anatoly..@gmail.com)
Date:Sun, 6 May 2007 11:48:26

Hello everybody!

Interbase 6, Windows 2000, Delphi6 sp1.

The title of my message is maybe a little bit confusing. Anyway, here is
what I wish to accomplish.

I need to write an application that will maintain my database. The
application will use gbak and gfix utilities. When I invoke them with my
program I naturally need to be able to access their output. As far as I
can see they print to a "cmd" window when invoked manually.

Question 1: how can I change that and be able to access their output in
my application??

Question 2: what is a good way of invoking them from my program?
"ShellExecute"? "CreateProcess"?

Of course I could just run a bat script instead of calling gbak and gfix
  from my program but then it I would loose some flexibility, control,
and  besides that I have not much experience with scrips at all.

Please, help me!

Best regards,
Anatoly

Replies:

www.cryer.info
Managed Newsgroup Archive