I want to get the system's default checkbox for to display it in an owner-drawn MFC menu. I have read this question, but that did not answer my question.
I want to implement this line:
hbmpCheckboxes = LoadBitmap((HINSTANCE) NULL,
(LPTSTR) OBM_CHECKBOXES);
which I got from MSDN, section Simulating Check Boxes in a Menu
I get this error: Error C2065 'OBM_CHECKBOXES': undeclared identifier
If I define it myself: #define OBM_CHECKBOXES 32759
, and I run the code, then LoadBitmap returns a handle. In VS2015 I see this: hbmpCheckboxes 0xc305143c {unused=??? }
, so to me it seems an invalid bitmaphandle is returned. I think there is more missing than just the OBM_CHECKBOXES define, but I can't figure out what.
Have a look at this topic.
You want to use CBitmap::LoadOEMBitmap
and note the comment at the bottom:
Note that the constant OEMRESOURCE must be defined before including WINDOWS.H in order to use any of the OBM_ constants.