So, I've run upon a little problem here. I could easily find the answer myself, of course, but my left-click finger hurts today, so I decided to ask Neowin :p
So there's mah little code that is supposed to launch things. It also works.
s := EntryConstData[Header.Current].Executable;
p := EntryConstData[Header.Current].Parameters;
d := EntryConstData[Header.Current].Directory;
ShellExecute(0, 'open', PChar(s), PChar(p), PChar(d), SW_SHOWNORMAL);
I've decided that mah code needs to wait until the launched thing terminates, so that's why I changed the last line to this.
if Length(p) > 0 then
s := s + ' ' + p;
ZeroMemory(@si, SizeOf(TStartupInfo));
ZeroMemory(@pi, SizeOf(TProcessInformation));
si.cb := SizeOf(TStartupInfo);
h := CreateProcess(nil, PChar(s), nil, nil, false, 0, nil, PChar(d), si, pi);
WaitForSingleObject(pi.hProcess, INFINITE);
Now, however, some of the things launch and then crash with Exception code 0xc0000005. What gives?
Question
Phouchg
So, I've run upon a little problem here. I could easily find the answer myself, of course, but my left-click finger hurts today, so I decided to ask Neowin :p
So there's mah little code that is supposed to launch things. It also works.
I've decided that mah code needs to wait until the launched thing terminates, so that's why I changed the last line to this.
Now, however, some of the things launch and then crash with Exception code 0xc0000005. What gives?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts