   directdraw7 secondary surfaces problem
  Hello everybody. I''m having a runtime error with DirectDraw7 involving creating secondary surfaces. Everything worked fine until I added the code for creating a secondary surface.I set the cooperation level with Windows like this:lpdd->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN);My program is supposed to open up a window and draw a few pixels. Instead, the application simply sets the display resolution and immediately terminates without any error messages or any other notification. If I add a DDSCL_EXCLUSIVE flag along with the DDSCL_FULLSCREEN flag, instead of setting the display mode and terminating, it ran partially (opened up a window but did not paint the pixels I had programmed) and immediately gave me a "this program has performed an illegal operation" error.Removing any code dealing with the secondary surface lets the program run normally.I''m using the Microsoft Visual C++ 6.0 compiler. I even took the code samples from the book that used secondary surfaces (From Windows Game Programming for Dummies) and compiled them myself, the same errors occured. Because of that I''m guessing that maybe the error is a result of my compiler configuration.Please help! Any replies would be greatly appreciated. 