while ( data->state )
{
#if wxUSE_STREAMS && !defined(__WXWINCE__)
- bufOut.Update();
- bufErr.Update();
+ if ( !bufOut.Update() && !bufErr.Update() )
#endif // wxUSE_STREAMS
-
- // don't eat 100% of the CPU -- ugly but anything else requires
- // real async IO which we don't have for the moment
- ::Sleep(50);
+ {
+ // don't eat 100% of the CPU -- ugly but anything else requires
+ // real async IO which we don't have for the moment
+ ::Sleep(50);
+ }
// we must process messages or we'd never get wxWM_PROC_TERMINATED
traits->AlwaysYield();
return dwExitCode;
}
-long wxExecute(wxChar **argv, int flags, wxProcess *handler)
+template <typename CharType>
+long wxExecuteImpl(CharType **argv, int flags, wxProcess *handler)
{
wxString command;
+ command.reserve(1024);
for ( ;; )
{
if ( !*argv )
break;
- command += _T(' ');
+ command += ' ';
}
return wxExecute(command, flags, handler);
}
+
+long wxExecute(char **argv, int flags, wxProcess *handler)
+{
+ return wxExecuteImpl(argv, flags, handler);
+}
+
+#if wxUSE_UNICODE
+
+long wxExecute(wchar_t **argv, int flags, wxProcess *handler)
+{
+ return wxExecuteImpl(argv, flags, handler);
+}
+
+#endif // wxUSE_UNICODE