Home > Software engineering > Why is my COMBOBOX how are created to invoke the Create not successful
Why is my COMBOBOX how are created to invoke the Create not successful
Time:09-21
Int CAddressBar: : OnCreate (LPCREATESTRUCT LPCREATESTRUCT) { If (CPanel: : OnCreate (lpCreateStruct)==1) return -1;
//TODO: here to add your special creation code if (! M_imgTool. The IsNull ()) return 0; M_imgTool. LoadFromResource (AfxGetInstanceHandle (), IDB_TOOLBAR);
If (m_btnGo. M_hWnd) return 0; If (m_addressComboBox. M_hWnd) return 0;
It is the code that is what problem? Pray god help M_addressComboBox. Create (WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWN | CBS_HASSTRINGS | CBS_OWNERDRAWVARIABLE, CRect (5, 5, rcClient Width () - 22, 200), and this, 10001);
CodePudding user response:
CBS_OWNERDRAWVARIABLE, there must be
//Derived class is responsible for implementing these handlers // for the owner/self the draw controls (except for the optional called DeleteItem) Void CComboBox: : DrawItem (LPDRAWITEMSTRUCT) {ASSERT (FALSE); } Void CComboBox: : MeasureItem (LPMEASUREITEMSTRUCT) {ASSERT (FALSE); } Int CComboBox: : CompareItem (LPCOMPAREITEMSTRUCT) {ASSERT (FALSE); return 0; }