I'm building a dll in C++ to be imported into a VB project. The dll exposes a function that will extract the preview image of a specified document through the Win Shell, and then writes it into a buffer to be used by the VB app.
So far, I'm able to get the HBITMAP handle without issue. I was also able to extract the bitmap data using the GetBitmapBits function. However, this will not work as the object that requires the bit data needs it to be in a device independent format.
I've read that GetDiBits is the function to use for this purpose, but I'm having a hard time figuring out how to call the function successfully.
What device context should I be using? Also, how can I ensure that it writes out the data in device independent format?
Thanks in advance.