DIBs again...

I was asking some days ago for some examples about rendering to DIBs.
Finally I did it, but still some strange beaviours happens, let’s explain :

I create the DIB that way, I create a BITMAPINFO and a BITMAPINFOHEADER and then I create the DIB with CreateDIBSection().

Then I select a pixel format creating the PIXELFORMATDESCRIPTOR and selecting it with ChoosePixelFormat and then SelectPixelFormat.

Everything (seems) go right, I must say I’ve set the same parameters for the window rendering and the DIB rendering (pixelformat, size, depth etc.).

The problem is that when I render to window everything goes right, when I render to the DIB it looks like rendered in 4 colours.

I gave a try rendering first to the backBuffer of the window and then, after the Flush and finish I render to the DIB and put it on the same window with StretchBlt to see differences.

Can someone help me ? Why the rendering on the DIB looks like 4 colours, while the one “on the window” is right when I’ve set the same parameters ??