This is the code I have:
HWND WebformCreate(HWND hParent, UINT id)
{
return CreateWindowEx(0, WEBFORM_CLASS, _T("about:blank"),
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 0, 0, 100, 100, hParent,
(HMENU)id, GetModuleHandle(NULL), 0);
}
This is the warning I get:
warning C4312: 'type cast' : conversion from 'UINT' to 'HMENU' of greater size
These are the questions I have:
- Why does the compiler think it's a bad idea to cast to a bigger type?
- What's the best way to get rid of the warning? (I don't want to disable it.)
- Doing a double type cast like this:
(HMENU)(UINT_PTR)id
gets rid of the warning. Why/how? - Disabling "Detect 64-bit Portability Issues" (Wp64) also gets rid of the warning. Why is Wp64 deprecated? Should I have it on?