IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++/CLI Discussion :

Probleme avec un tuto


Sujet :

C++/CLI

  1. #1
    Inactif
    Inscrit en
    Octobre 2008
    Messages
    826
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 826
    Points : 172
    Points
    172
    Par défaut Probleme avec un tuto
    Bonjorus,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    #include <iostream>
    #include <windows.h>
    #include <stdio.h>
    int main(int argc, char * argv[])
    {
         HWND hMediaplayer = FindWindow("Sans - Titre - Bloc-notes",NULL);
         printf("le handle de la fenêtre de media player 2 est : 0x%X",hMediaplayer);
         system("pause");
    	 return 0;
    }
    Ce code m'envoie ces erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    27
    28
    29
    30
    31
    32
    33
    34
    35
     
    'test2.exe'*: Chargé 'C:\Users\airrivals\Documents\Visual Studio 2010\Projects\test2\Debug\test2.exe', Les symboles ont été chargés.
    'test2.exe'*: Chargé 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\mscoree.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcp100d.dll', Les symboles ont été chargés.
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcr100d.dll', Les symboles ont été chargés.
    'test2.exe'*: Chargé 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcr100_clr0400.dll', Cannot find or open the PDB file
    Exception de première chance à 0x753b9673 dans test2.exe*: 0x04242420: 0x4242420.
    'test2.exe'*: Chargé 'C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\74353039393f68f4c068cc37f759e5be\mscorlib.ni.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\assembly\NativeImages_v4.0.30319_32\System\5a8bf6ab1a6ba60e7355fa4cc61fd0c5\System.ni.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\apphelp.dll', Cannot find or open the PDB file
    Le thread 'Thread Win32' (0xd84) s'est arrêté avec le code -1073741510 (0xc000013a).
    Le thread 'Thread Win32' (0x1a70) s'est arrêté avec le code -1073741510 (0xc000013a).
    Le thread 'Thread Win32' (0x1f58) s'est arrêté avec le code -1073741510 (0xc000013a).
    Le thread 'Thread Win32' (0x25c8) s'est arrêté avec le code -1073741510 (0xc000013a).
    Le programme '[8140] test2.exe: Natif' s'est arrêté avec le code -1073741510 (0xc000013a).
    Et mon application me retourne sa :
    le handle de la fenetre de media player 2 est : 0x0Appuyez sur une touche pour continuer...
    Je pense pas que sa doit donner sa si ?

  2. #2
    Rédacteur
    Avatar de Neitsa
    Homme Profil pro
    Chercheur sécurité informatique
    Inscrit en
    Octobre 2003
    Messages
    1 041
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Chercheur sécurité informatique

    Informations forums :
    Inscription : Octobre 2003
    Messages : 1 041
    Points : 1 956
    Points
    1 956
    Par défaut
    Bonjour,

    A priori, la fenêtre n'est pas trouvée. Il te manque au moins une vérification, à savoir tester si le HWND est NULL.

    De plus, d’après l'aide de FindWindow() tu as inversé les deux paramètres. Le 1er est la nom de la classe et le 2nd le titre de la fenêtre.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
     
     
    #include <iostream>
    #include <windows.h>
    #include <stdio.h>
    int main(int argc, char * argv[])
    {
         HWND hMediaplayer = FindWindow(NULL, "Sans - Titre - Bloc-notes");
         if (hMediaplayer == NULL)
         {
              printf("Erreur : Impossible de trouver la fenetre.\n");
              return -1;
         }
         printf("le handle de la fenêtre de media player 2 est : %p\n", hMediaplayer);
         system("pause");
         return 0;
    }

  3. #3
    Inactif
    Inscrit en
    Octobre 2008
    Messages
    826
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 826
    Points : 172
    Points
    172
    Par défaut
    Voila sa devrai etre mieux.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    #include <iostream>
    #include <windows.h>
    #include <stdio.h>
    int main(int argc, char * argv[])
    {
         HWND hMediaplayer = FindWindow("Sans Titre - Bloc-notes", NULL);
         if (hMediaplayer == NULL)
         {
              printf("Erreur : Impossible de trouver la fenetre.\n");
              return -1;
         }
         printf("le handle de la fenêtre de media player 2 est : %p\n", hMediaplayer);
         system("pause");
         return 0;
    }
    Maitenant j'ai une autre erreur.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    27
    28
    29
    30
    31
    32
    33
    34
     
    'test2.exe'*: Chargé 'C:\Users\airrivals\Documents\Visual Studio 2010\Projects\test2\Release\test2.exe', Les symboles ont été chargés.
    'test2.exe'*: Chargé 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\mscoree.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcr100.dll', Les symboles ont été chargés.
    'test2.exe'*: Chargé 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\msvcr100_clr0400.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\74353039393f68f4c068cc37f759e5be\mscorlib.ni.dll', Cannot find or open the PDB file
    'test2.exe' (Managé (v4.0.30319))*: 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' chargé
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\System32\cryptbase.dll', Cannot find or open the PDB file
    'test2.exe' (Managé (v4.0.30319))*: 'c:\users\airrivals\documents\visual studio 2010\Projects\test2\Release\test2.exe' chargé, symboles chargés.
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll', Cannot find or open the PDB file
    'test2.exe'*: Chargé 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll', Cannot find or open the PDB file
    Le thread 'Thread Win32' (0x1db0) s'est arrêté avec le code -1 (0xffffffff).
    Le thread 'Thread Win32' (0x2204) s'est arrêté avec le code -1 (0xffffffff).
    Le thread 'Thread Win32' (0x2060) s'est arrêté avec le code -1 (0xffffffff).
    Le programme '[3100] test2.exe: Natif' s'est arrêté avec le code -1 (0xffffffff).
    Le programme '[3100] test2.exe: Managé (v4.0.30319)' s'est arrêté avec le code -1 (0xffffffff).
    On peux pas copier un nom de fenetre ?

  4. #4
    Expert éminent sénior
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 074
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 074
    Points : 12 120
    Points
    12 120
    Par défaut
    Vous inversez toujours les paramètres de la fonction FindWindow.

    "Spy++" est ton ami.

  5. #5
    Expert éminent
    Avatar de Melem
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2006
    Messages
    3 656
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Janvier 2006
    Messages : 3 656
    Points : 8 389
    Points
    8 389
    Par défaut
    Ces messages apparaissent quand tu tentes de déboguer une application compilée en release. Choisis "exécuter sans déboguage" au lieu de "déboguer" dans le menu pour lancer ton programme et ils disparaîtront aussitôt.

  6. #6
    Inactif
    Inscrit en
    Octobre 2008
    Messages
    826
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 826
    Points : 172
    Points
    172
    Par défaut
    Merci beaucoup.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Forms]probleme avec le tuto forms 9i/10g
    Par xheo dans le forum Forms
    Réponses: 2
    Dernier message: 01/04/2011, 15h41
  2. probleme avec le tuto organigramme
    Par missvai dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 25/06/2008, 16h23
  3. Problème avec le tuto XPCE
    Par niniwizard dans le forum Prolog
    Réponses: 2
    Dernier message: 10/08/2007, 13h45
  4. [socket]probleme avec le tuto
    Par albatr0ss dans le forum Réseau
    Réponses: 5
    Dernier message: 24/12/2006, 11h46
  5. [Kylix] probleme avec un imagelist
    Par NicoLinux dans le forum EDI
    Réponses: 4
    Dernier message: 08/06/2002, 23h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo