void SoundLibrary::Init(HWND hWnd)
{
// (lpDirectSound is LPDIRECTSOUND type)
//
// this returns DS_OK:
DirectSoundCreate(NULL, &lpDirectSound, NULL);
// but this returns DSERR_INVALIDPARAM:
lpDirectSound->SetCooperativeLevel(hWnd, DDSCL_NORMAL);
Because of this, all calls such as Play() etc. to buffers produces DSERR_PRIOLEVELNEEDED - so why does SetCooperativeLevel() fail?
The hWnd parameter is valid, what else could be wrong?
Thanks
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
DirectSound Cooperation Level Error
Hi,
I''m adding a DirectSound wrapper class to my app, and I''ve written this code (keep in mind I''m using the DX5 SDK):
Oh, and while I''m here....do you think it''s faster to Blt() a fullscreen 800x600x16 buffer to another, or lock it and then memcpy() each line?
Okay, sorry, I guess I need to be a teensy bit more specific...
Are you sure that your "valid" hWnd handle is the handle to the hWnd that you are expecting? Have you compared the memory address of that hWnd with the hWnd you created to run the game in? Valid handle does not necessarily mean valid window to do a create with.
-fel
Are you sure that your "valid" hWnd handle is the handle to the hWnd that you are expecting? Have you compared the memory address of that hWnd with the hWnd you created to run the game in? Valid handle does not necessarily mean valid window to do a create with.
-fel
yeah, I checked it out...in the same Init() function, I tested the validity with getdc() and textout() - it worked, so I guess it''s valid...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement