SetCooperativeLevel()

Started by
3 comments, last by elfin 23 years, 9 months ago
I am trying to set my cooperative level for directX. It keeps failing.Here is part of my code. HRESULT ddrval; ddrval=lpdd->SetCooperativeLevel(MWH,DDSCL_EXCLUSIVE / DDSCL_FULLSCREEN / DDSCL_ALLOWREBOOT); if(ddrval!=DD_OK) { GameState=GSSHUTDOWN; } When I run the program it errors out with exclusive and fullscreen. However when I put it to normal it is fine. Any ideas on why this is happening?
Advertisement
Whats the return value your getting?
Are you using the ''OR'' character (''/'') or the DIVIDE character (''/'')?

Vyvyan
You know. I may be the biggest computer bug there ever was. I will explain what I did. For in the likeliness that others will do the same as I.
#define GSINIT 0 //Game state values
#define GSMENU 1
#define GSRUNNING 2
#define GSSHUTDOWN 3

GameState=0; //sets the game state to init

switch(GameState)
{
case GSINIT:
{
if(DirectDrawCreateEx(NULL,
(VOID**)&lpdd,IID_IDirectDraw7,NULL)!=DD_OK)
{
GameState=GSSHUTDOWN;
}
if(lpdd->SetCooperativeLevel(main_window_handle,DDSCL_FULLSCREEN / DDSCL_EXCLUSIVE / DDSCL_ALLOWREBOOT)!=DD_OK)
{
GameState=GSSHUTDOWN;
}
if(lpdd->SetDisplayMode(800,600,8,0,0)!=DD_OK)
{
GameState=GSSHUTDOWN;
}
} //Notice I didn''t set GameState to GSRUNNING?
It looped around and tried to setup DDRAW and failed cause it was setup already.
I think I win the award for stupid mistakes.
And what do learn from this?

No, "do some debugging before you post" is not the right answer here.

As usual, we learn NOTHING!

Yeah, I''m complaining...
~~~ "'impossible' is a word in the dictonary of fools" --Napoleon

This topic is closed to new replies.

Advertisement