I run my programs from an editor that captures their console output, and so I noticed that a program of mine outputs the message "not a dib section" (actually it outputs "not a dib seciton").

I tracked down the problem and found out that this happens whenever the GradientFill API is called, but only if it draws on a backbuffer. I used to create my backbuffer with CreateCompatibleBitmap, so I changed it and created it with CreateDIBSection. Now, the message changed and became "bddraw = 0". The GradientFill API works OK, and I wouldn't have noticed the problem if I didn't notice the console output. If I don't pass the handle of the backbuffer DC but the handle returned by BeginPaint, I see no output.

I have made a simple program to illustrate the problem. If you run it from the batch file, it will redirect its output to the "gfprob.txt" file. If you comment out the CreateDIBSection line and uncomment the CreateCompatibleBitmap line, you will see the other message. If you comment out the GradientFill line, you will see no message.

I suppose this might be happening with other bitmap functions too (like FloodFill), but what exactly do the 2 messages mean ?
Posted on 2002-11-04 07:18:44 by micmic
Are you running a debug build of Windows?
Posted on 2002-11-04 14:54:30 by sluggy
No, plain old 98SE. You mean that you didn't notice any output in your system ? The Msimg32.dll in my system is version 5.00.1693.1 and (probably) comes from the Platform SDK of November 2001. Currently I have pushed the dust under the carpet, i.e. I redirected the std output to a pipe and I see no more messages :). It is strange however: Since there are no messages when I pass the DC handle from BeginPaint, it makes me wonder in what way is a Compatible DC different from my window DC, and how does GradientFill know the difference...
Posted on 2002-11-04 16:10:40 by micmic