Beware of xxx_cast

Add or remove tool buttons and menus; Add dialog boxes;

2025-11-16

Written by: xiaobin

The default version uses MSVC >=1930, which is Visual Studio 2022.

Non-enforce

Enforce

MSVC

In MSVC, XXX_cast (C++ standard) is still under continuous improvement.

UINT_PTR

typedef UINT_PTR            WPARAM;
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);

Handle

// The system calls this function to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CBaseDemoDlg::OnQueryDragIcon()
{
	return static_cast<HCURSOR>(m_hIcon);
}

Ref