A problem for IDirectSound8

Started by
1 comment, last by loseredkimo 20 years, 7 months ago
When I use IDirectSound8::SetCooperativeLevel(); always have problem... I show my source code... ---------------------------------------------- #include <iostream> #include <tchar.h> #include <windows.h> #include <dmusici.h> using namespace std; IDirectSound8* g_pDS = NULL; int _tmain(int argc, _TCHAR* argv[]) { CoInitialize( 0 ); if( FAILED( DirectSoundCreate8( NULL, &g_pDS, NULL ) ) ) { MessageBox( NULL, "Unable to create!!", "Error", MB_OK ); return 0; } if( FAILED( g_pDS->SetCooperativeLevel(NULL,DSSCL_NORMAL) ) ) { MessageBox( NULL, "can''t setCooperative","Error",MB_OK ); return 0; } return 0; } ----------------------------------------------------------- But it always has error for g_pDS->SetCooperativeLevel(); How do I do?? P.S. I have include libraries: dsound.lib & dxguid.lib
hi...
Advertisement
And it return DSERR_INVALIDPARAM...
What does it mean??
hi...
My guess is your passing a null window handle? I don''t really know much about DSound. I recommend you check the DirectX docs for details on the SetCooperativeLevel().

Nine times out of ten, DSERR_INVALIDPARAM means you''re asking DirectX to do something that just doesn''t make any sense in DX''s world. Like enabling multi-sampling on a 3d card that doesn''t support it.
--- - 2D/Pixel Artist - 3D Artist - Game Programmer - Ulfr Fenris[[ Gaping Wolf Software ]] [[ GameGenesis Forums ]]

This topic is closed to new replies.

Advertisement