I am trying to create a CCombobox with the following code:
CComboBox* cSearchBar = new CComboBox();
if (!cSearchBar->Create(WS_VISIBLE | WS_CHILD | WS_TABSTOP | CBS_OWNERDRAWFIXED | CBS_DROPDOWN | CBS_AUTOHSCROLL, CRect(150,10,325,15), this, IDC_COMBO))
TRACE0("Failed to create search bar\n");
But it gives an error message of "Debug Assertion Failed" on
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winctrl1.cpp, Line 271
This problem only occurs when I try to create the CCombobox with CBS_OWNERDRAWFIXED
flag. Someone please tell me how to create a CCombobox programmatically with Owner Drawn property set to fixed.