Lire un fichier wav

Résolu
cs_youma85 Messages postés 82 Date d'inscription dimanche 18 février 2007 Statut Membre Dernière intervention 28 avril 2011 - 23 févr. 2008 à 14:27
cs_youma85 Messages postés 82 Date d'inscription dimanche 18 février 2007 Statut Membre Dernière intervention 28 avril 2011 - 23 févr. 2008 à 19:39
salut tous le monde lorsque j'execute ce programme on me donne ses erreur

#include <Windows.h>
#include <mmsystem.h>
#include "resource.h"

HINSTANCE hInst;
LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam);

int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
hInst=hInstance;
DialogBox(hInstance,(LPCTSTR)IDD_MAIN,NULL,(DLGPROC)MainProc);
return 0;
}

LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam)
{
    int Select;
    char buf[MAX_PATH];
    OPENFILENAME DlgInfs;
    switch(message)
    {
        case WM_COMMAND:
        Select=LOWORD(wParam);
        switch(Select)
        {
            case IDC_PARCOURIR:
                memset(&DlgInfs,0,sizeof(OPENFILENAME));
                DlgInfs.lStructSize=sizeof(OPENFILENAME);
                DlgInfs.hwndOwner=Dlg;
                DlgInfs.hInstance=hInst;
                DlgInfs.lpstrFilter="Fichiers WAV*.WAV";
                DlgInfs.lpstrFile=buf;
                DlgInfs.nMaxFile=MAX_PATH;
                DlgInfs.lpstrTitle="Choisissez le fichier à lire.";
                DlgInfs.Flags=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST;
                if(GetOpenFileName(&DlgInfs))
                    SetDlgItemText(Dlg,IDC_NOMDEFICHIER,buf);
                    return TRUE;
            case IDC_LIRE:
                GetDlgItemText(Dlg,IDC_NOMDEFICHIER,buf,MAX_PATH);
                sndPlaySound(buf,SND_ASYNC);
                return TRUE;

            case IDCANCEL:
                sndPlaySound(NULL,NULL);
                EndDialog(Dlg,0);
                return TRUE;
        }
        default:
        return FALSE;
    }
}
voila les erreurs:

Linking...
MAIN.OBJ : error LNK2001: unresolved external symbol __imp__sndPlaySoundA@8
Debug/projet5.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

merci d avance

2 réponses

cs_juju12 Messages postés 966 Date d'inscription samedi 3 avril 2004 Statut Membre Dernière intervention 4 mars 2010 4
23 févr. 2008 à 15:50
ajoute #pragma comment(lib,"winmm.lib")
3
cs_youma85 Messages postés 82 Date d'inscription dimanche 18 février 2007 Statut Membre Dernière intervention 28 avril 2011 1
23 févr. 2008 à 19:39
merci ca y est j'ai reussi à le compiler grace à toi
0
Rejoignez-nous