   SetDisplayMode
  Hey all,I did a simple directx program that sets the program to full screen with the resolution 640x480 the compile goes ok but when i run the program there is a Debug error telling me this:"The value of ESP os not properly saved across a function call.This is usually a result of calling a function declared with one calling convention with a function pointer declared with a diffreant calling convention"...What the hell that means?Here is a part of my source codeint Game_Init(void *parms = NULL, int num_parms = 0){    // create the DirectDraw object  if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))  {   // error  } // end if  // now query for IDirectDraw7  if (FAILED(lpdd->QueryInterface(IID_IDirectDraw7,  (LPVOID *)&lpdd7)))  {  // error  } // end if    if (FAILED(lpdd7->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX |DDSCL_EXCLUSIVE | DDSCL_ALLOWREBOOT)))  {    // error  } // end if // set display mode to 640x480x8  if (FAILED(lpdd7->SetDisplayMode(640,    480,8))) { MessageBox(NULL, "Error init SetDisplayMode:Error E/1",  "DirectDraw Error",   MB_OK | MB_ICONEXCLAMATION); return(0); } // end if// return success or failure return(1);} // end Game_InitNow, i have noticed that the problem happens only when i put the SetDisplayMode. if his not there the problem dosen''t accour.Thanks a lot 
  I know this might be completely useless or wrong, but... do you have directx 7 installed (or 8, or 9) ? ;  Yes i got directx 9 installed ;  cleaves you''re reading Tricks of the Windows Game Programing Gurus, aren''t you? sorry can''t help you with that but if you''re reading the book I mentioned above you''ll have to do a lot of work to make things work. I had to rewrite almost every function in it. But it''s still worth reading. I like it.   The essence of balance is detachment. To embrace a cause, to grow fond or spiteful, is to lose one''''s balance after which, no action can be trusted. Our burden is not for the dependent of spirit.   - Mayar, Third Keeper ;  ya i''m reading that book...the book itself is good but damn i''m always got to change something;quote:Original post by cleves  "The value of ESP os not properly saved across a function call.This is usually a result of calling a function declared with one calling convention with a function pointer declared with a diffreant calling convention"...What the hell that means?I suspect a driver bug, as you''re not (in this code at least) changing the call convention nor using assembly.Update your gfx (and mainboard?) driver, and see if the problem goes away.Been there myself... 