Hallo
Ich habe eine Problem mit der procedure ShellExecute_AndWait.
Bei Delphi 7 lief sie 1a, nur jetzt bei Delphi 2005 gabs immer Probs.
Hier mal der Source:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
| procedure ShellExecute_AndWait(FileName: string; Params: string); var exInfo: TShellExecuteInfo; Ph: DWORD; begin FillChar(exInfo, SizeOf(exInfo), 0); with exInfo do begin cbSize := SizeOf(exInfo); fMask := SEE_MASK_NOCLOSEPROCESS or SEE_MASK_FLAG_DDEWAIT; Wnd := GetActiveWindow(); ExInfo.lpVerb := 'open'; ExInfo.lpParameters := PChar(Params); lpFile := PChar(FileName); nShow := SW_SHOWNORMAL; end; if ShellExecuteEx(@exInfo) then Ph := exInfo.HProcess else begin ShowMessage(SysErrorMessage(GetLastError)); Exit; end; while WaitForSingleObject(ExInfo.hProcess, 50) <> WAIT_OBJECT_0 do Application.ProcessMessages; CloseHandle(Ph); end; |
Als fehler zeigt er mit diese Zeile an:
Delphi-Quelltext
1: 2:
| begin FillChar(exInfo, SizeOf(exInfo), 0); |
Mit dem FillChar kommt er nicht klar. Hat jemand eine Idee?
Danke
Moderiert von
Christian S.: Code- durch Delphi-Tags ersetzt.Moderiert von
Christian S.: Topic aus Sonstiges verschoben am Sa 27.08.2005 um 12:00