I am using CreateDIBSection() to create a HBITMAP from a buffer, but sometimes – with no regular occurrence – I get a NULL pointer from it. I can’t understand what may cause the function to return a NULL pointer because – as I said before – it is not regular. Sometimes it happens after displaying 10 frames, sometimes after 2 frames.
Can someone explain me which are the possible reasons of the unexpected fail?
I am using CreateDIBSection() to create a HBITMAP from a buffer, but sometimes –
Share
If this function is failing at random, I would be inclined to think that the buffer is not correctly formatted or is messed up. Go back in the code that creates the buffer and see if any of the functions fail there. I would suspect that a functions return status is not being correctly checked before the code continues.