| | |
MFC - CList RemoveAt() function
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Hello guys i keep getting a
However according to MSDN the code is right:
the above code works and the error only occurs if itterate through the list by using Next and Back buttons and functions:
Can anyone suggest where i've gone wrong please?
Thanks
•
•
•
•
Unhandled exception at 0x7c177ac0 (mfc71d.dll) in LSMUtility.exe: 0xC0000005: Access violation reading location 0xcdcdcdbd.
C Syntax (Toggle Plain Text)
void CTemp::OnDelete() { // TODO: Add your control notification handler code here CLSMUtilityDlg *main_dlg = (CLSMUtilityDlg *) GetParent(); if(pos != main_dlg->BTList.GetTailPosition()) { main_dlg->BTList.RemoveAt(pos); MessageBox("deleted"); } }
the above code works and the error only occurs if itterate through the list by using Next and Back buttons and functions:
C Syntax (Toggle Plain Text)
void CTemp::OnNext() { // TODO: Add your control notification handler code here CLSMUtilityDlg *main_dlg = (CLSMUtilityDlg *) GetParent(); if(pos != main_dlg->BTList.GetTailPosition()) { main_dlg->BTList.GetNext(pos); Display(); } else MessageBox("end"); } //and Pervious void CTemp::OnPervious() { // TODO: Add your control notification handler code here CLSMUtilityDlg *main_dlg = (CLSMUtilityDlg *) GetParent(); if(pos != main_dlg->BTList.GetHeadPosition()) { main_dlg->BTList.GetPrev(pos); Display(); } else MessageBox("At beginning"); }
Thanks
Access violation reading location 0xcdcdcdbd. "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
•
•
•
•
Originally Posted by Dave Sinkula
Isn't that how uninitialized memory is filled in debug mode?Access violation reading location 0xcdcdcdbd.
![]() |
Similar Threads
- Basic doubt (C++)
- MFC Listener (C)
- Passing variables around in a MFC project (C++)
- Class Vectorization requirements (C++)
- MFC Socket programming problem (C)
- Quit abruptly in MFC app (C++)
Other Threads in the C Forum
- Previous Thread: write apps for windows pda or palmOS pda in C?
- Next Thread: Please guide me in making an airlines database
| Thread Tools | Search this Thread |
Tag cloud for C
#include ansi array arrays asterisks binarysearch calculate centimeter changingto char convert copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic fflush file fork forloop framework getlasterror givemetehcodez grade graphics gtkgcurlcompiling hacking hardware histogram homework inches include incrementoperators input iso kernel km lazy linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix microsoft motherboard multi mysql number opendocumentformat opensource owf pattern pdf performance pointer posix problem probleminc process program programming radix recursion recv repetition research reversing scanf scripting segmentationfault sequential shape socket socketprograming spoonfeeding standard string strings structures student systemcall testing threads turboc unix user variable voidmain() wab windows.h windowsapi






