what’s happening is that the call to ChoosePixelFormat( ) is unable to find a pixelformat close enough to the requested one (because your card doesn’t support it).
the only way around it is, as the other post said, is to enumerate the video modes, and choose which one is closest.
basically how u do that is to call Describe PixelFormat(), changing the iPixelFormat( 2nd ) parameter, and check the returned PFD, storing the format number and the PFD in a linked list. (the list is the actual enumeration).
all you do next is choose which pfd is closest, and call SetPixelFormat( ) w/ the pixelformat’s number and PFD.
okay, here’s where i’m lost, usually ChoosePixelFormat() does this for you, and returns the index into the closest matching pixel format…
why it’s not doing this is beyond me, my only speculation is that, maybe, your requesting a 24 bit color depth, your card only supports 8 bits, and when you try to set the, say, 4th supported pixel format( which is 8 bit) using a 24 bit pfd, windows gets mad. (or some such variation of bits and what not )
i’m not sure how to fix it, but that’s what the problem is.
hope it helps…