有没有办法将HDC(afxwin.h)转换为WORD(unsigned short)?我尝试使用static_cast
和C样式转换,但两者都无济于事。有人有想法吗?
HDC x;
WORD y = static_cast<WORD>(x);
[无效的类型转换]
HDC x;
WORD y = (WORD)x;
[警告C4302:'输入':从'HDC'截断到'WORD']
实际代码行
DefWindowProc(WM_ICONERASEBKGND, (WORD)dc.m_hDC, 0L);