[clean-list] Launching an executable on WinTel...

Diederik van Arkel diederik@cs.kun.nl
Wed, 23 May 2001 13:42:34 +0200


Van: "Fabien Todescato" <f.todescato@larisys.fr>

> Dear Cleaners,
>
> And ObjectIO1.2.1 practitioners, does anyone of you know how to invoke
from
> a Clean program an executable, additionnaly providing that executable with
> command-line arguments ?
>
> Seeing that the IDE does do it, I guess it is possible :)

Hi Fabien,

you'll want to use the WinLaunchApp2 function from the clCCall_12 module.
The
first argument is the commandline ie the app. name + arguments, the second
argument is the working directory for the app you launch, the third argument
indicates wether you are launching a console application.

Remember to use windows style quoting for the commandline stuff and
directory.
To call the function you will need an OSToolbox, the cleanest way to do
this:

# (ok,pState) = accPIO (accOSToolbox (WinLaunchApp2 ...)) pState

This is assuming you only want to launch the executable without waiting for
its
return code, if you need that instead you'lll need to use WinCallProcess
which
is slightly more involved. Let me know if you need that and I'll dig up the
details.

Regards,

Diederik van Arkel