Autor Beitrag
Newhack
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 16.10.05 23:15 
Hallo.
Hab seit kurzen ein Problem bie Delphi.
Habe Delphi2005.

Ich wollte mit dieser Prozedure arbeiten:
ausblenden 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:
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
 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.

ausblenden Delphi-Quelltext
1:
[Fehler] Unit2.pas(39): E2003 Undefinierter Bezeichner: 'FillChar'					


Kann da jemand helfen?

Danke
Newhack ;)

Moderiert von user profile iconraziel: Quote- durch Delphi-Tags ersetzt
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mo 17.10.05 02:50 
interessant, fillchar sollte dein delphi schon kennen -> system.pas.
alternativ kannst du auch statt
ausblenden Delphi-Quelltext
1:
FillChar(exInfo, SizeOf(exInfo), 0);					

ZeroMemory(@exInfo, SizeOf(exInfo)); verwenden

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Newhack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 17.10.05 08:44 
Kann mir jemand mal die system.pas geben? Viellt. ist meine defekt. Wo soll ich die datei dann hni kopieren?


Bei ZeroMemory kommt der gleiche Fehler :(
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mo 17.10.05 12:40 
www.delphi-forum.de/...47359&highlight= <- das wird hier nicht gerne gesehen!
die system.pas bzw dcu ist grundbestandteil deiner delphi installation.
hier hilft vermutlich nur neuinstallieren.

alternativ kannst du auch folgende proc verwenden
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure ZeroMemory(p:pointer; count:integer);
  var pend: pbyte;
begin
  pend := cardinal(p) + count;
  while cardinal(p) < cardinal(pend) do begin
    pbyte(p)^ := 0;
    inc(p);
  end;
end;

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Newhack Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 17.10.05 13:55 
Danke retnyg

Dennoch gibt jetzt Delphi ein Fehler bei pbyte an.

[Fehler] Unit2.pas(34): E2410 Unsichere Zeigervariablen, Parameter oder Konstanten sind nur in unsicheren Prozeduren zulässig

Neuinstallation hatte bis jetzt auch kein ERfolg. :(
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mo 17.10.05 13:57 
user profile iconNewhack hat folgendes geschrieben:
Dennoch gibt jetzt Delphi ein Fehler bei pbyte an.

type pbyte = ^byte;
user profile iconNewhack hat folgendes geschrieben:
[Fehler] Unit2.pas(34): E2410 Unsichere Zeigervariablen, Parameter oder Konstanten sind nur in unsicheren Prozeduren zulässig

das hört sich für mich so an als ob du versuchst, WIN32 CODE IN EINER .NET ANWENDUNG EINZUFÜGEN, was natürlich nicht geht.

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...