Original Post
When I try to run a VC++ program calling DirectDrawCreate or DirectDrawCreateEx my monitor light turns yellow (like in power saving mode) and I cannot continue without restarting my PC (a real pain). I bought "Sam's Tricks of the Windows Game Programming Gurus" and compiled the demo source:
I probably made an error in typing that out but you get the picture. The application doesn't do anything except initialize DirectX (and do everything in the Win32 wrapper which includes WinMain and WndProc if you are wondering where they are.
Anyway, when I run my compiled executable, my monitor doesn't turn off, but enters power saving mode (or something similar to that). The computer is still working normally (including sound, input, etc.) but the monitor does not work, even when I turn it off and on. In the end I just press Ctrl-Alt-Del (my three most frequently used keys probably) twice to restart and then the display comes back with all the BIOS stuff. Also I know that the problem is NOT caused after the call to DirectDrawCreateEx() because I tried putting a MessageBox directly after it and it didn't appear before the monitor shut down. The strange thing is that the Precompiled version from the CD works fine so it must be a compilation problem. I am using the DirectX 8.1b SDK and the book uses DirectX 8.0a but since DirectDraw is version 7 and lower that won't matter.
If anyone has an idea as to how I could solve this please tell me because it is currently blocking me from the beautiful paradise that is DirectX and I am growing towards insanity (or maybe OpenGL). My faulty application and the Precompiled one are HERE. But save all work before testing the faulty one. If you can make it work then also tell me because it could be my PC that is the problem. Thanks for any help.
>>>>>>>>>>>>>>>>>
Ilthigore
<<<<<<<<<<<<<<<<<
[edited by - ilthigore on December 21, 2002 8:21:20 AM]
[edited by - ilthigore on December 21, 2002 10:30:43 AM]
LPDIRECTDRAW7 lpDD;
int GameInit() //The initialization function in my Win32 wrapper
{
if(FAILED(DirectDrawCreateEx(NULL, (void**)lpDD, IID_IDirectDraw7, NULL)))
return 0;
if(FAILED(lpDD->SetCooperativeLevel(g_hWnd, DDSCL_NORMAL)))
return 0;
return 1;
}
int GameRelease() //The shutdown function in my Win32 wrapper
{
if(lpDD)
{
lpDD->Release();
lpDD=NULL;
}
return 1;
}