Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read from file question ... Pin
Hadi Rezaee8-Apr-01 3:48
Hadi Rezaee8-Apr-01 3:48 
GeneralRe: Read from file question ... Pin
AlexMarbus8-Apr-01 6:08
AlexMarbus8-Apr-01 6:08 
GeneralRe: Read from file question ... Pin
Hadi Rezaee8-Apr-01 6:52
Hadi Rezaee8-Apr-01 6:52 
GeneralRe: Read from file question ... Pin
Dharne Atul8-Apr-01 8:33
Dharne Atul8-Apr-01 8:33 
QuestionCListCtrl - Delete Selected Items??? Pin
Ryan Baillargeon7-Apr-01 22:04
Ryan Baillargeon7-Apr-01 22:04 
AnswerRe: CListCtrl - Delete Selected Items??? Pin
AlexMarbus8-Apr-01 3:37
AlexMarbus8-Apr-01 3:37 
GeneralRe: CListCtrl - Still Not Working... Pin
Ryan Baillargeon8-Apr-01 6:24
Ryan Baillargeon8-Apr-01 6:24 
GeneralRe: CListCtrl - Still Not Working... Pin
Michael Dunn8-Apr-01 8:24
sitebuilderMichael Dunn8-Apr-01 8:24 
I am only deleteing every other Item that is selected, SO if I am deleteing item 123456 which are all selected using that code above leaves 246 intact and still selected.

That's because when you delete item 1, the result is that 12345 are selected (2-6 shift down to 1-5), so the next time through your loop you skip the new item 1, item 2 (previously 3) gets deleted, and so on.
Easy way to fix: In your loop, get the first selected item and delete it. Then get the first selected item again and delete it. Repeat until there are no more selected items. This may be slow if your list is big, though.
Snazzier way to fix: Loop thru and make a list of the indexes of all selected items. Then delete them working from the highest index to the lowest.

--Mike--
http://home.inreach.com/mdunn/
All your base are belong to ME~!
GeneralEVERYTHING IS JUST FINE NOW Pin
Ryan Baillargeon8-Apr-01 10:44
Ryan Baillargeon8-Apr-01 10:44 
GeneralRe: CListCtrl - Still Not Working... Pin
Frank Deo1-Aug-01 10:28
Frank Deo1-Aug-01 10:28 
GeneralRe: CListCtrl - Delete Selected Items??? Pin
Ryan Baillargeon8-Apr-01 6:56
Ryan Baillargeon8-Apr-01 6:56 
Generaldetect wince hybernation Pin
7-Apr-01 9:11
suss7-Apr-01 9:11 
GeneralRe: detect wince hybernation Pin
Anders Molin8-Apr-01 3:28
professionalAnders Molin8-Apr-01 3:28 
QuestionHow do I read raw data from a HD Pin
Ben Burnett7-Apr-01 9:05
Ben Burnett7-Apr-01 9:05 
AnswerRe: How do I read raw data from a HD Pin
Michael Dunn7-Apr-01 9:21
sitebuilderMichael Dunn7-Apr-01 9:21 
GeneralRe: How do I read raw data from a HD Pin
Ben Burnett7-Apr-01 9:40
Ben Burnett7-Apr-01 9:40 
GeneralCFile and my class Pin
Ahmad6-Apr-01 23:39
Ahmad6-Apr-01 23:39 
GeneralRe: CFile and my class Pin
AlexMarbus7-Apr-01 6:16
AlexMarbus7-Apr-01 6:16 
GeneralRe: CFile and my class Pin
Michael Dunn7-Apr-01 9:24
sitebuilderMichael Dunn7-Apr-01 9:24 
QuestionDLL newing objects on process heap? Pin
6-Apr-01 16:19
suss6-Apr-01 16:19 
AnswerRe: DLL newing objects on process heap? Pin
Michael Dunn6-Apr-01 18:48
sitebuilderMichael Dunn6-Apr-01 18:48 
GeneralRe: DLL newing objects on process heap? Pin
7-Apr-01 6:52
suss7-Apr-01 6:52 
AnswerRe: DLL newing objects on process heap? Pin
Tim Deveaux7-Apr-01 13:37
Tim Deveaux7-Apr-01 13:37 
QuestionDirectDraw in a CView -> possible? Pin
Michael Menne6-Apr-01 14:20
Michael Menne6-Apr-01 14:20 
GeneralConverting Pin
Drake Elsari6-Apr-01 13:16
Drake Elsari6-Apr-01 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.