(75 pts) Getting StdPicture object from pointer to HBITMAP
Posted on 2000-05-06
I'm working with 2 DLL functions that do Bitmap picture conversions. One takes a StdPicture OLE picture object and convert it to an array of RGB values, the other takes an array and converts it to a StdPicture bitmap.
In the first conversion function, the C function is asking for an HBITMAP (which is the same as an StdPicture in VB, only it's a pointer to the bitmap instead of a bitmap object) and it returns the array of RGB values. I pass it an StdPicture where it asks for the HBITMAP, and it returns the array fine... this works great. I guess it takes the StdPicture and works with it internally in C.
The second conversion function asks for the array of RBG values and converts them to an HBITMAP. I pass it the array of RBG values and when I put the return value into a Long, it works fine. However, when I try to put the return value into an StdPicture, it crashes VB. The Long value returned is the pointer to the HBITMAP I assume.
I guess what I'm looking for is either a way to get an StdPicture OLE picture object from a Long pointer to a bitmap, or an explanation of how the HBITMAP thing works in C so I can get the StdPicture from it in VB.
NOTE - Long is the equivelant of HBITMAP in VB so when I try to do a straight conversion from the Long to StdPicture, I get a "Type Missmatch" error.
Please Help !