If your application fails during device creation, check for the following common errors:
ˇYou must specify DDSCAPS_3DDEVICE when you create the DirectDraw surface.
ˇIf you're using a palettized device, you must attach the palette.
ˇIf you're using a z-buffer, you must attach it to the rendering target.
ˇMake sure you check the device capabilities, particularly the render depths.
ˇCheck whether you are using system or video memory.
ˇEnsure that the registry has not been corrupted.