|I edited the code block. buf was initialized, of course, further above.
In ShellExecute() I tried 'callString' and 'buf' as parameter. But only 'buf' worked.
'buf' is in the example NOT in the ShellExecute(), since I tried last with 'callString'. hm ... I post the code differently ...
size = GetCurrentDirectoryA( 512, buf );
sprintf_s( id, "%d", pid );
sprintf_s( callString, "%s\\%s", buf, file.c_str() );
long res=long(ShellExecute(0, "open", callString, id, 0, SW_SHOWNORMAL));
sprintf_s( callString2, "c:\\Users\\zwatschek\\work\\svn\\incubation\\ttsServer\\Data\\ttsWatchdog.exe" );
res=long(ShellExecute(0, "open", callString2, id, 0, SW_SHOWNORMAL));
And still, the contents of callString and callString2 are the same. Version 2 works, version 1 not.
I´ll look into the len parameter of sprintf_s. But I don´t think that´s it.
modified on Monday, October 5, 2009 5:26 AM