Archived

This topic is now archived and is closed to further replies.

loseredkimo

A problem for IDirectSound8

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites