Debug Assertion?
-
Hello, In my MFC application I have two similar dialog boxes. Each have a List Control Box and each has a varaible (of type CListCtrl) associated to them. One of them works fine but I get a Debug Assertion error on the first of these four lines in the second dialog. m_MyListControl2.InsertItem(0, Line1, 0) m_MyListControl2.SetItemText(0, 1, Line2); m_MyListControl2.SetItemText(0, 2, Line3); m_MyListControl2.SetItemText(0, 3, Line5); The dialog boxes all have the same header files and the contents of DoDataExchange() are similar too. Does anyone know why this is happening? Thanks, Aoife
-
Hello, In my MFC application I have two similar dialog boxes. Each have a List Control Box and each has a varaible (of type CListCtrl) associated to them. One of them works fine but I get a Debug Assertion error on the first of these four lines in the second dialog. m_MyListControl2.InsertItem(0, Line1, 0) m_MyListControl2.SetItemText(0, 1, Line2); m_MyListControl2.SetItemText(0, 2, Line3); m_MyListControl2.SetItemText(0, 3, Line5); The dialog boxes all have the same header files and the contents of DoDataExchange() are similar too. Does anyone know why this is happening? Thanks, Aoife
if you didn't make those calls in OnInitDialog then it's because they haven't been created yet.
-
Hello, In my MFC application I have two similar dialog boxes. Each have a List Control Box and each has a varaible (of type CListCtrl) associated to them. One of them works fine but I get a Debug Assertion error on the first of these four lines in the second dialog. m_MyListControl2.InsertItem(0, Line1, 0) m_MyListControl2.SetItemText(0, 1, Line2); m_MyListControl2.SetItemText(0, 2, Line3); m_MyListControl2.SetItemText(0, 3, Line5); The dialog boxes all have the same header files and the contents of DoDataExchange() are similar too. Does anyone know why this is happening? Thanks, Aoife
What does the debug assertion say. Not only does it usually print text about why it asserted, but if you look at the source code where the assert was raise, it sometimes gives you information about what you need to do to correct the problem. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
if you didn't make those calls in OnInitDialog then it's because they haven't been created yet.
-
What does the debug assertion say. Not only does it usually print text about why it asserted, but if you look at the source code where the assert was raise, it sometimes gives you information about what you need to do to correct the problem. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
It says that the "Debug Assertion Failed" in file winctrl.cpp at line 547. void CListCtrl::DrawItem(LPDRAWITEMSTRUCT) { ASSERT(FALSE); } This is a MFC\src file. It gives no other reason as to why its happening. Thanks
Then it looks like your list control is marked as owner drawn but you aren't handling the DrawItem routine to draw it. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
Then it looks like your list control is marked as owner drawn but you aren't handling the DrawItem routine to draw it. Tim Smith I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
-
in the resource editor, open your dialog, double click the listbox then find and un-check the box that says "Owner Drawn" . -c
I don't care, and you can't make me.
-
in the resource editor, open your dialog, double click the listbox then find and un-check the box that says "Owner Drawn" . -c
I don't care, and you can't make me.