Re: WIN32: Spawning a command-line process
- From: jcupitt gmail com
- To: Tor Lillqvist <tml iki fi>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: WIN32: Spawning a command-line process
- Date: Tue, 27 Jan 2009 10:39:38 +0000
2009/1/27 Tor Lillqvist <tml iki fi>:
If you don't want to do that, your simplest option is to just build
two separate versions of the "prog" program: One linked with
-mwindows, one without. Note that you don't have to change a single
line of code to make it into a "GUI" application, just link it with
-mwindows.
Another common solution is to make the main .exe a GUI, then have a
separate tiny non-GUI wrapper program that runs the main GUI, captures
the output, and connects to stdin/stdout.
In my project I have nip2.exe, my main GUI app, then nip2-cli.exe, a
command-line program that runs nip2.exe and redirects. Here's the
source:
http://vips.svn.sourceforge.net/viewvc/vips/nip2/trunk/src/nip2-cli.c?view=markup
It could probably use one of the g_spawn_*() functions and save some
space, but it's adapted from another non-glib project.
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]