The line of code you've presented isn't getting the handle to anything - it's apparently trying to recover the pointer to a
CComboBox
MFC wrapper object that's a child of the window that supplies the
this
pointer the code is executed under.
So...
IF you really want a pointer to the MFC wrapper object NEVER use
reinterpret_cast
, use static cast.
auto pComboBox = static_cast<ccombobox>( GetDlgItem( IDC_COMBO1 ) );</ccombobox>
IF you actually want the handle use the
m_hWnd
member of whatever is returned by
GetDlgItem
, e.g.
auto handle = GetDlgItem( IDC_COMBO1 )->m_Hwnd;
Try those lines of code and see what happens. If neither do what you want perhaps modify your question to reflect what you want to do!