-
Win32 with C++
I know that there it is possible to program Win32 applications using C++, but half the time, I get all kinds of errors, based off of things that were fine in C, but a no-no in C++. For example...
Code:
HBITMAP CreateBitmap(int nWidth, int nHeight,
UINT cPlanes, UINT cBitsPerPixel,
CONST VOID* lpvBits);
I'm refering to the last perameter specifically. In C, using a void* is fine, but when I try to use this function in C++, I get an error for casting an int* as a void*. How would I work around things like this?
-
Make sure you take into consideration const.
Kuphryn
-
What do you mean? Would I need to remove that for C++.
-
No, I was thinking of casting from within CreateBitmap().
static_cast() should be fine.
Kuphryn
-
I believe reinterpret_cast would be more appropriate since it's a pointer-to-pointer conversion.
-
Ahh. I still have much to learn of C++. Heh.