GetFileSize()

Résolu
shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013 - 20 nov. 2005 à 21:03
shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013 - 20 nov. 2005 à 21:28
Bonjour,



je continu mon programme sur le decoupage de fichiers en parts et je
veux calculer la taille d'un fichier cependans quand je compile sous
vc++ il me met



------ Build started: Project: prog, Configuration: Release Win32 ------



Compiling...

prog.cpp

c:\Documents and Settings\Administrator\My Documents\Prog
C\prog\cut.h(1) : warning C4101: 'pointeur' : unreferenced local
variable

c:\documents and settings\administrator\my documents\prog
c\prog\cut.h(27) : warning C4700: local variable 'hfl' used without
having been initialized

Linking...



Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Prog C\prog\Release\BuildLog.htm"

---------------------- Done ----------------------



Build: 1 succeeded, 0 failed, 0 skipped





et voici le code maintenant:


//calcul du nombre d'octets et initialisation

HANDLE hfl;

DWORD filesize;

CreateFile(filename,0,FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

filesize = GetFileSize(hfl, 0);

CloseHandle(hfl);







alors que dois je changer dans le code?
.

2 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
20 nov. 2005 à 21:19
hfl = CreateFile(...)

ciao...
http://dev.winsysdev.com
BruNews, MVP VC++
3
shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013
20 nov. 2005 à 21:28
ah ok :) mici
0
Rejoignez-nous