Click here to Skip to main content
15,915,328 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralInprocess object handler for Ms-Office Pin
anshumanshinde8-Apr-04 1:02
anshumanshinde8-Apr-04 1:02 
QuestionATL bug with CComPtr and VS2003 ? Pin
Ray Gregory6-Apr-04 7:41
Ray Gregory6-Apr-04 7:41 
AnswerRe: ATL bug with CComPtr and VS2003 ? Pin
Mike Dimmick8-Apr-04 2:00
Mike Dimmick8-Apr-04 2:00 
GeneralRe: ATL bug with CComPtr and VS2003 ? Pin
Ray Gregory8-Apr-04 4:55
Ray Gregory8-Apr-04 4:55 
GeneralRe: ATL bug with CComPtr and VS2003 ? Pin
Ray Gregory8-Apr-04 9:27
Ray Gregory8-Apr-04 9:27 
GeneralRe: ATL bug with CComPtr and VS2003 ? Pin
Bo Hunter8-Apr-04 16:00
Bo Hunter8-Apr-04 16:00 
GeneralDeleting Lists Pin
mcsherry6-Apr-04 1:28
mcsherry6-Apr-04 1:28 
GeneralRe: Deleting Lists Pin
Mike Dimmick6-Apr-04 2:05
Mike Dimmick6-Apr-04 2:05 
delete( *it ) should work, but you should probably do it in two stages: first delete the objects pointed to, then delete the list elements (the pointers themselves). My RemoveAll would probably look something like:
for ( list<int*>::iterator it = l.begin(); 
      it < l.end();
      ++it )
{
  delete( *it );
}
 
l.erase( l.begin(), l.end() );
where l is a list<int*>

[EDIT] To make it clear, I think the problem you're having is that you're deleting the current element, pointed to by this iterator, before moving to the next element, so the iterator can't get the next element. You could handle this in the classic linked-list fashion, by retrieving the next value of the iterator before deleting this one. [/EDIT]

Stability. What an interesting concept. -- Chris Maunder
GeneralRe: Deleting Lists Pin
mcsherry6-Apr-04 2:21
mcsherry6-Apr-04 2:21 
GeneralRe: Deleting Lists Pin
_Magnus_6-Apr-04 2:25
_Magnus_6-Apr-04 2:25 
GeneralRe: Deleting Lists Pin
mcsherry6-Apr-04 2:32
mcsherry6-Apr-04 2:32 
GeneralRe: Deleting Lists Pin
Paul Ranson6-Apr-04 2:43
Paul Ranson6-Apr-04 2:43 
GeneralRe: Deleting Lists Pin
Nemanja Trifunovic6-Apr-04 5:13
Nemanja Trifunovic6-Apr-04 5:13 
GeneralStoring,retrieving from an object. Pin
Member 6170675-Apr-04 5:47
Member 6170675-Apr-04 5:47 
GeneralRe: Storing,retrieving from an object. Pin
Mike Dimmick6-Apr-04 2:21
Mike Dimmick6-Apr-04 2:21 
GeneralRe: Storing,retrieving from an object. Pin
f6422-Apr-04 15:49
f6422-Apr-04 15:49 
General: IPersistStorage::Load() for Embeded object of Word Creates .doc file in Temp Pin
anshumanshinde5-Apr-04 3:15
anshumanshinde5-Apr-04 3:15 
GeneralRelease of Events params Pin
El'Cachubrey5-Apr-04 2:06
El'Cachubrey5-Apr-04 2:06 
GeneralRe: Release of Events params Pin
Steve S5-Apr-04 2:15
Steve S5-Apr-04 2:15 
GeneralRe: Release of Events params Pin
El'Cachubrey5-Apr-04 4:09
El'Cachubrey5-Apr-04 4:09 
GeneralSTL Question Pin
Josef Schroettle4-Apr-04 4:17
Josef Schroettle4-Apr-04 4:17 
GeneralRe: STL Question Pin
Jörgen Sigvardsson4-Apr-04 8:55
Jörgen Sigvardsson4-Apr-04 8:55 
GeneralRe: STL Question Pin
Josef Schroettle5-Apr-04 7:27
Josef Schroettle5-Apr-04 7:27 
GeneralRe: STL Question Pin
Jörgen Sigvardsson5-Apr-04 12:01
Jörgen Sigvardsson5-Apr-04 12:01 
GeneralRe: STL Question Pin
Josef Schroettle6-Apr-04 7:26
Josef Schroettle6-Apr-04 7:26 

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.