|
-
September 30th, 2004, 07:45 PM
#1
CListCtrl Bug
Situation:
I am writing my own version of windows registry (regedit). I am able to load all registry keys (using RegEnumKey). I am also able to enumerate values of a given registry key (using RegEnumValue). Just like in the registry; name, type, and data are displayed to a listview (CListCtrl).
I store each data to a CString object. I do not have problem in getting data no matter how big the size is.
My problem is this, when the size of data is big (712 bytes for example), I got an assertion error when I am about to add it to the listview.
The error is in the following codes of afxcmn.inl
occurs when I place the code GetListCtrl().GetItemCount()
Code:
_AFXCMN_INLINE int CListCtrl::GetItemCount() const
{ ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETITEMCOUNT, 0, 0L); }
when I remove the GetItemCount() and tried to insert the item at index 0, the the error is in the following code
Code:
_AFXCMN_INLINE int CListCtrl::InsertItem(int nItem, LPCTSTR lpszItem)
{ ASSERT(::IsWindow(m_hWnd)); return InsertItem(LVIF_TEXT, nItem, lpszItem, 0, 0, 0, 0); }
What could be the problem? It is very strange for me because I am able to add data to the listiview when the size is only about 90 bytes, higher than 90 causes the above assertion error.
If you have encountered this kind of bug and you have found the solution, please give me a hint. I would highly appreciate that. Thanks!
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|