Autor Beitrag
mg4all
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Di 05.08.08 21:56 
Hallo Leute !

Ich habe leider wieder mal ein kleines Problem. Ich versuche eine test.exe Datei mit der CopyFileEx zu kopieren. Hier mein Quelltext.

ausblenden Delphi-Quelltext
1:
CopyFileEx(PChar('test.exe'),PChar('backup\test.exe'),true);					


Leider bekomme ich immer die Meldung "Inkompatiple Typen 'Boolean' und 'Pointer'". Kann damit leider nichts anfangen. Kann mir jemand helfen ???

MFG

_________________
Wer nicht fragt hat schon verloren !!!
wirbeldelphi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 29



BeitragVerfasst: Di 05.08.08 22:03 
BOOL CopyFileEx(

LPCWSTR lpExistingFileName, // pointer to name of an existing file
LPCWSTR lpNewFileName, // pointer to filename to copy to
LPPROGRESS_ROUTINE lpProgressRoutine, // pointer to the callback function
LPVOID lpData, // to be passed to the callback function
LPBOOL pbCancel, // flag that can be used to cancel the operation
DWORD dwCopyFlags // flags that specify how the file is copied
);


pointer to the callback function <> boolean

lpProgressRoutine

Specifies the address of a callback function of type LPPROGRESS_ROUTINE that is called each time another portion of the file has been copied. This parameter can be NULL. For more information on the progress callback function, see CopyProgressRoutine.

_________________
Ich bin keine Signatur - ich putz hier nur.
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Di 05.08.08 22:09 
Sorry i dont understand !

Kannst du das bitte auf deutsch schreiben.

_________________
Wer nicht fragt hat schon verloren !!!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 05.08.08 22:11 
Ich übersetze mal:
Nutze CopyFile und nicht CopyFileEx, dann funktionierts :mrgreen:

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Di 05.08.08 22:15 
Danke für die Antwort.

Das ist mir schon klar, denn das habe ich bis jetzt benutzt. Ich möchte aber eine Fortschrittsanzeige sehen, deshalb versuche ich es mit CopyFileEx.

_________________
Wer nicht fragt hat schon verloren !!!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 05.08.08 22:26 
Okay, neuer Versuch:
Vielleicht hilft dir dieses Beispiel:
www.michael-puff.de/...pets/CopyFileEx.html

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Di 05.08.08 22:32 
Danke !

Aber leider ist mir das viel zu hoch. :oops:
Gibt es keine einache Lösung dafür ? :?:
Was bedeutet denn der Pointer ? :idea:

_________________
Wer nicht fragt hat schon verloren !!!
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 06.08.08 09:18 
Dort trägst die Adresse deiner Callback-Funktion ein.