Probleme avec tlhelp32.h

Résolu
cs_miki42 Messages postés 23 Date d'inscription vendredi 16 mai 2008 Statut Membre Dernière intervention 24 août 2008 - 27 juil. 2008 à 22:29
cs_miki42 Messages postés 23 Date d'inscription vendredi 16 mai 2008 Statut Membre Dernière intervention 24 août 2008 - 27 juil. 2008 à 23:03
Bonjour a tous un probleme qui je doit le dire me laisse perplexe,j'utilise   "CreateToolhelp32Snapshot" pour enumérer des processus hors lors de la compilation apres avoir inclut tlhelp32.h le compilateur m'indique un tas d'erreur lier a tlhelp32.h je poste le code ainsi que les erreur détecter lors de la compilation:
#include<tlhelp32.h>
#include <stdio.h>
#include <stdlib.h>




int main(int argc, char *argv[])
{
  HANDLE hSnapShot;
    PROCESSENTRY32 uProcess;
    BOOL r;


    hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
    uProcess.dwSize = (DWORD) sizeof(PROCESSENTRY32);


    r = Process32First(hSnapShot, &amp;uProcess);
    do 
    {
        // uProcess contient les informations
        r = Process32Next(hSnapShot, &amp;uProcess);
    } while ( r );


    CloseHandle(hSnapShot);
  system("PAUSE>0"); 
  return 0;


et voici les erreur que dev c++ m'indique :


Compilateur: Default compiler
Building Makefile: "C:\Users\miki\Desktop\Makefile.win"
Exécution de  make clean
rm -f main.o  Projet1.exe


gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"  


In file included from main.c:1:
C:/Dev-Cpp/include/tlhelp32.h:36: error: syntax error before "DWORD"
C:/Dev-Cpp/include/tlhelp32.h:38: error: syntax error before "th32HeapID"
C:/Dev-Cpp/include/tlhelp32.h:39: error: syntax error before "dwFlags"
C:/Dev-Cpp/include/tlhelp32.h:44: error: syntax error before "DWORD"


C:/Dev-Cpp/include/tlhelp32.h:46: error: syntax error before "dwAddress"
C:/Dev-Cpp/include/tlhelp32.h:47: error: syntax error before "dwBlockSize"
C:/Dev-Cpp/include/tlhelp32.h:48: error: syntax error before "dwFlags"
C:/Dev-Cpp/include/tlhelp32.h:49: error: syntax error before "dwLockCount"
C:/Dev-Cpp/include/tlhelp32.h:50: error: syntax error before "dwResvd"
C:/Dev-Cpp/include/tlhelp32.h:51: error: syntax error before "th32ProcessID"


C:/Dev-Cpp/include/tlhelp32.h:52: error: syntax error before "th32HeapID"
C:/Dev-Cpp/include/tlhelp32.h:57: error: syntax error before "DWORD"
C:/Dev-Cpp/include/tlhelp32.h:59: error: syntax error before "th32ProcessID"
C:/Dev-Cpp/include/tlhelp32.h:60: error: syntax error before "th32DefaultHeapID"
C:/Dev-Cpp/include/tlhelp32.h:61: error: syntax error before "th32ModuleID"
C:/Dev-Cpp/include/tlhelp32.h:62: error: syntax error before "cntThreads"
C:/Dev-Cpp/include/tlhelp32.h:63: error: syntax error before "th32ParentProcessID"
C:/Dev-Cpp/include/tlhelp32.h:64: error: syntax error before "pcPriClassBase"
C:/Dev-Cpp/include/tlhelp32.h:65: error: syntax error before "dwFlags"
C:/Dev-Cpp/include/tlhelp32.h:66: error: syntax error before "szExeFile"
C:/Dev-Cpp/include/tlhelp32.h:66: error: `MAX_PATH' undeclared here (not in a function)
C:/Dev-Cpp/include/tlhelp32.h:67: error: syntax error before '}' token
C:/Dev-Cpp/include/tlhelp32.h:70: error: syntax error before "DWORD"
C:/Dev-Cpp/include/tlhelp32.h:72: error: syntax error before "th32ProcessID"
C:/Dev-Cpp/include/tlhelp32.h:73: error: syntax error before "th32DefaultHeapID"
C:/Dev-Cpp/include/tlhelp32.h:74: error: syntax error before "th32ModuleID"
C:/Dev-Cpp/include/tlhelp32.h:75: error: syntax error before "cntThreads"
C:/Dev-Cpp/include/tlhelp32.h:76: error: syntax error before "th32ParentProcessID"
C:/Dev-Cpp/include/tlhelp32.h:77: error: syntax error before "pcPriClassBase"


C:/Dev-Cpp/include/tlhelp32.h:78: error: syntax error before "dwFlags"
C:/Dev-Cpp/include/tlhelp32.h:79: error: syntax error before "szExeFile"
C:/Dev-Cpp/include/tlhelp32.h:80: error: syntax error before '}' token
C:/Dev-Cpp/include/tlhelp32.h:82: error: syntax error before "DWORD"


C:/Dev-Cpp/include/tlhelp32.h:84: error: syntax error before "th32ThreadID"
C:/Dev-Cpp/include/tlhelp32.h:85: error: syntax error before "th32OwnerProcessID"


C:/Dev-Cpp/include/tlhelp32.h:86: error: syntax error before "tpBasePri"
C:/Dev-Cpp/include/tlhelp32.h:87: error: syntax error before "tpDeltaPri"
C:/Dev-Cpp/include/tlhelp32.h:88: error: syntax error before "dwFlags"
C:/Dev-Cpp/include/tlhelp32.h:91: error: syntax error before "DWORD"
C:/Dev-Cpp/include/tlhelp32.h:93: error: syntax error before "th32ProcessID"
C:/Dev-Cpp/include/tlhelp32.h:94: error: syntax error before "GlblcntUsage"
C:/Dev-Cpp/include/tlhelp32.h:95: error: syntax error before "ProccntUsage"
C:/Dev-Cpp/include/tlhelp32.h:96: error: syntax error before '*' token
C:/Dev-Cpp/include/tlhelp32.h:97: error: syntax error before "modBaseSize"
C:/Dev-Cpp/include/tlhelp32.h:98: error: syntax error before "hModule"
C:/Dev-Cpp/include/tlhelp32.h:99: error: syntax error before "szModule"


C:/Dev-Cpp/include/tlhelp32.h:100: error: syntax error before "szExePath"
C:/Dev-Cpp/include/tlhelp32.h:101: error: syntax error before '}' token
C:/Dev-Cpp/include/tlhelp32.h:103: error: syntax error before "DWORD"
C:/Dev-Cpp/include/tlhelp32.h:105: error: syntax error before "th32ProcessID"
C:/Dev-Cpp/include/tlhelp32.h:106: error: syntax error before "GlblcntUsage"
C:/Dev-Cpp/include/tlhelp32.h:107: error: syntax error before "ProccntUsage"
C:/Dev-Cpp/include/tlhelp32.h:108: error: syntax error before '*' token
C:/Dev-Cpp/include/tlhelp32.h:109: error: syntax error before "modBaseSize"
C:/Dev-Cpp/include/tlhelp32.h:110: error: syntax error before "hModule"
C:/Dev-Cpp/include/tlhelp32.h:111: error: conflicting types for 'szModule'
C:/Dev-Cpp/include/tlhelp32.h:99: error: previous declaration of 'szModule' was here
C:/Dev-Cpp/include/tlhelp32.h:113: error: syntax error before '}' token


C:/Dev-Cpp/include/tlhelp32.h:114: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:115: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:116: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:117: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:118: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:119: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:120: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:121: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:122: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:123: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:124: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:125: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:126: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:127: error: syntax error before "WINAPI"


C:/Dev-Cpp/include/tlhelp32.h:128: error: syntax error before "WINAPI"
C:/Dev-Cpp/include/tlhelp32.h:129: error: syntax error before "WINAPI"


main.c: In function `main':
main.c:8: error: `HANDLE' undeclared (first use in this function)


main.c:8: error: (Each undeclared identifier is reported only once
main.c:8: error: for each function it appears in.)
main.c:8: error: syntax error before "hSnapShot"
main.c:10: error: `BOOL' undeclared (first use in this function)
main.c:12: error: `hSnapShot' undeclared (first use in this function)
main.c:13: error: `uProcess' undeclared (first use in this function)
main.c:13: error: `DWORD' undeclared (first use in this function)
main.c:13: error: syntax error before "sizeof"
main.c:15: error: `r' undeclared (first use in this function)
main.c: At top level:
C:/Dev-Cpp/include/tlhelp32.h:66: error: storage size of `szExeFile' isn't known
C:/Dev-Cpp/include/tlhelp32.h:79: error: storage size of `szExeFile' isn't known
C:/Dev-Cpp/include/tlhelp32.h:100: error: storage size of `szExePath' isn't known
C:/Dev-Cpp/include/tlhelp32.h:112: error: storage size of `szExePath' isn't known


make.exe: *** [main.o] Error 1


Exécution terminée
J'ai essayer avec code block pour voir si ça venai pa de dev c++ mais pareil alors si l'un de vous peut m'expliquer la raison de toute ses erreurs ça serai cool merci d'avance

2 réponses

cs_Lucky92 Messages postés 180 Date d'inscription mercredi 22 décembre 2004 Statut Membre Dernière intervention 16 août 2012 2
27 juil. 2008 à 22:57
Ajoute déjà tout en haut de ton programme

#include <windows.h>

ça devait aller un peu mieux...
3
cs_miki42 Messages postés 23 Date d'inscription vendredi 16 mai 2008 Statut Membre Dernière intervention 24 août 2008
27 juil. 2008 à 23:03
lol arff merci quel erreur stupide lol merci beaucoup
0
Rejoignez-nous