Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

jo...ich muss ein prog schreiben (Visual C++/MFC), dass unter anderem auch die funktion haben soll bestimmte files (*.ll) aus einem angegeben verzeichnis in ein vordefiniertes zu kopieren.

alles kein problem.

nur will ich das ganze gerne mit CopyFileEx machen, um in der CALLBACK fkt. auch den aktuellen kopierstatus abfragen zu können und demnach in einem "kopier-dialog" eine progressbar zu aktualisieren.

das programm lässt sich jetz ohne probleme kompilieren, linken und ausführen, bloß bewirkt der aufruf der fkt CopyFileEx rein gar nix. return davon is 0 und des wars :(

Der Aufruf:


case ID_SETDIR:
ret = CopyFileEx "D:\\test\\test.txt","D:\\asdf.txt",MyCopyProgressRoutine,NULL,
&cancel,COPY_FILE_RESTARTABLE);
[/php]

Die Callbackfkt:

[php]
DWORD CALLBACK MyCopyProgressRoutine(
LARGE_INTEGER TotalFileSize, // file size
LARGE_INTEGER TotalBytesTransferred, // bytes transferred
LARGE_INTEGER StreamSize, // bytes in stream
LARGE_INTEGER StreamBytesTransferred, // bytes transferred for stream
DWORD dwStreamNumber, // current stream
DWORD dwCallbackReason, // callback reason
HANDLE hSourceFile, // handle to source file
HANDLE hDestinationFile, // handle to destination file
LPVOID lpData // from CopyFileEx
)
{
//CDialogTest* ptr = (CDialogTest*)lpData;
// do something with pointer, e.g. ptr->m_Progressbar.Pos blahblah

DWORD percent = TotalBytesTransferred.LowPart*100/TotalFileSize.LowPart;
return TRUE;
}

weiß vllt irgendjemand nen rat??

biiiitte hilfe :(

bye

Wenn 0 zurückgegeben wird heißt das das ein Fehler aufgetreten ist. Welcher das genau ist kannst du dann mit GetLastError abfragen der dir die genaue Fehlernummer zurückgibt.

Diese Nummer kannst du dann entweder per Hand im Tool "Fehlermeldungen suchen" (das bei Visual Studio dabei ist) nachschauen oder per FormatMessage ´dir den Text holen.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.