Re: One little bug - XCC ForumRegister | Login | Search
History | Home | Messages

Voxel Section Editor II (v1.6) beta releaseWill23:39 19-12-2001
One little bugssanzing15:11 20-12-2001
Re: One little bugWill20:08 20-12-2001
Re: One little bugOlaf van der Spek23:13 20-12-2001
Re: One little bugWill23:19 20-12-2001
Re: One little bugOlaf van der Spek23:50 20-12-2001
Re: One little bugWill00:13 21-12-2001
Re: One little bugOlaf van der Spek00:16 21-12-2001

> > Even when launched with double-clicking?
> > You should not rely on args[0] anyway, because applications that launch your app could put anything in args[0] they want.

> really? args[1] might be anything, specified at the command-line or whatever, but surely args[0] is the command invoked to get the app running?

Look at the following code. The whole command line can be customised by the parent app.
<code>
static int create_process(const string& exe_name, const string& _cmd_line, bool wait)
{
char cmd_line[256];
strcpy(cmd_line, ("\"" + exe_name + "\" " + _cmd_line).c_str());
STARTUPINFO si;
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION pi;
int error = !CreateProcess(exe_name.c_str(), cmd_line, NULL, NULL, false, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi);
if (!error && wait)
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return error;
}
</code>


Re: One little bug; FIXABLE (?)Will01:16 21-12-2001


Home | Post | Users | Messages