Einzelnen Beitrag anzeigen

Newhack

Registriert seit: 1. Nov 2004
5 Beiträge
 
#1

Problem mit FillChar

  Alt 16. Okt 2005, 23:11
Hallo.
Hab seit kurzen ein Problem bie Delphi.
Habe Delphi2005.

Ich wollte mit dieser Prozedure arbeiten:
SQL-Code:
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;
Also einfach 2 Dateien kopieren. Dennoch hat Delphi ein Problem mit FillChar(exInfo, SizeOf(exInfo), 0);.
Die uses ShellApi ist auch drinne.

Kann da jemand helfen?

Danke
Newhack
  Mit Zitat antworten Zitat