[wxExecute] redirecting and hiding Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
MoonKid
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am
Contact:

[wxExecute] redirecting and hiding

Post by MoonKid » Wed May 13, 2009 3:06 pm

(Sorry, for x-post in the dev-newsgroup! I forgot to use the forum first.)

For example I call wxExecute this way

Code: Select all

wxArrayString arr;
wxExecute("MyApp.exe", arr, wxEXEC_ASYNC);
The flag ASYNC indicate that my application doesn't wait till MyApp.exe ends.
But it waits because of the 'arr' parameter.
Am I right?

But I need the 'arr' parameter (redirecting) to hide MyApp.exe.

So what can I do?
I want to hide MyApp.exe but I don't want to wait for MyApp.exe. I just want to start/execute it without care about when it ends.

Understand my problem?
Is it possible to solve that problem?

I am thinking about a workaround with a thread. I could call wxExecute() in an separate thread.

AkiraDev
Knows some wx things
Knows some wx things
Posts: 48
Joined: Tue May 24, 2005 9:13 am

Post by AkiraDev » Thu May 14, 2009 9:47 pm

It probably would indeed work.
A thread would indeed work, as long as you're sure that you either don't need the arr object or that the main thread won't access it until MyApp.exe is done writing to it.
Back, just not as often

Windows Vista SP1, Ubuntu 8.04
MinGW 3.4.5, GCC 4.2.1
Code::Blocks
wxWidgets 2.8.9

Post Reply