Re: [Dev-C++] Directx 9 - DirectSound problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Marek <sp...@we...> - 2003-10-30 15:16:42
|
Hello, Thanks for response. I got it: The third parameter was wrong, should be: LPDIRECTSOUNDBUFFER lpDSBuffer; IDirectSound_CreateSoundBuffer( lpDS, &dsbd, &lpDSBuffer, NULL ); I still don't know what doesn't it compile without modyfing dsound.h and mmsystem.h. do you have the same problem? Thanks, Marek > I think I see a problem, > > IDirectSound_CreateSoundBuffer( &pdsbuffer, &dsbd, &pdsbuffer, NULL ); > > why is there an underscore therE? > > and secondly (important) you must get a pointer to an interface and then use > that pointer to access the interface functions. > > Try that and see if it helps. > > Daniel > > >From: "Marek" <sp...@we...> > >To: dev...@li... > >Subject: [Dev-C++] Directx 9 - DirectSound problem > >Date: Wed, 29 Oct 2003 20:23:21 +0100 > > > > > > Hello, > > > > I'm trying to play sound from a C program using DirectSound ( Secondary > >Buffer ) and I'm getting an error: > >109 dxsound.c structure has no member named `CreateSoundBuffer' > > > > piece of code is: > > > >#include <windows.h> > >#include <mmsystem.h> > >#include <dsound.h> > > > >[...] > > > > IDirectSound pds; /* DirectSound object */ > > IDirectSoundBuffer pdsbuffer; /* sound buffer */ > > > >/* initialization of DirectSound, CooperativeLevel etc. */ > > /* create wave format description */ > > memset( &pcmwf, 0, sizeof( WAVEFORMATEX ) ); > >/* filling the values */ > > /* create sound buffer description */ > > memset( &dsbd, 0, sizeof( DSBUFFERDESC ) ); > >/* filling the values */ > > > > IDirectSound_CreateSoundBuffer( &pdsbuffer, &dsbd, &pdsbuffer, NULL ); > > > >does anyone know the solution to this? I can send the entire unit if > >needed. > > > > > >Also when I tried to compile I was getting duplicate definition errors > >between > >dsound.h and mmsystem.h. > > > >The changes I had to make were: > >in mmsystem.h > >line 1008: > >change > >#ifndef _WAVEFORMATEX_ > >#define _WAVEFORMATEX_ > >to: > >#ifndef _WAVEFORMATEX_ > >#define _WAVEFORMATEX_ > >#define _LPCWAVEFORMATEX_DEFINED > > > >in dsound.h > >line 1899: > >change: > >typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; > >to: > >//typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; > > > >Am I missing something? > > > >Thanks in advance, > >Marek > > > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: SF.net Giveback Program. > >Does SourceForge.net help you be more productive? Does it > >help you create better code? SHARE THE LOVE, and help us help > >YOU! Click Here: http://sourceforge.net/donate/ > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > _________________________________________________________________ > Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile |