Click here to Skip to main content
15,916,693 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralSTL:: list Pin
vikramlinux16-Mar-04 0:46
vikramlinux16-Mar-04 0:46 
GeneralRe: STL:: list Pin
Mike Beckerleg16-Mar-04 3:13
Mike Beckerleg16-Mar-04 3:13 
GeneralRe: STL:: list Pin
Nemanja Trifunovic16-Mar-04 5:36
Nemanja Trifunovic16-Mar-04 5:36 
GeneralRe: STL:: list Pin
Jörgen Sigvardsson16-Mar-04 13:22
Jörgen Sigvardsson16-Mar-04 13:22 
GeneralRe: STL:: list Pin
vikramlinux16-Mar-04 17:19
vikramlinux16-Mar-04 17:19 
GeneralRe: STL:: list Pin
Todd Smith17-Mar-04 6:46
Todd Smith17-Mar-04 6:46 
GeneralRe: STL:: list Pin
Jörgen Sigvardsson17-Mar-04 6:53
Jörgen Sigvardsson17-Mar-04 6:53 
GeneralRe: STL:: list Pin
Jörgen Sigvardsson17-Mar-04 6:59
Jörgen Sigvardsson17-Mar-04 6:59 
Then you should create your own deleter functor, much like the one in the example provided by Nemanja. The difference will be the actual call to delete. Since you have allocated an array of TCHAR, you should use delete[] when freeing it. delete will work for simple TCHARs - because there is no ~TCHAR to be called for each element in the array. However, make a habit or you might run into problems when you have code like this:
class Class {
    OtherClass* pObj;
public:
    Class() { pObj = new OtherClass(); }
    ~Class() { delete pObj; }
};

...

Class* arr = new Class[10];
...
delete arr; // The memory chunk pointed to by arr is freed, but
            // the destructor is only called for the first object.
            // Hence you'll have 9 memory leaks (see ~Class())
            // delete [] ensures that all destructors for all elements
            // are called.


Remember! delete for single objects, delete [] for arrays. Smile | :)

--
Futue te et ipsum caballum.
GeneralRe: STL:: list Pin
Todd Smith17-Mar-04 13:03
Todd Smith17-Mar-04 13:03 
GeneralComposite Control, SetWindowPos being ignored Pin
gldnrtvr15-Mar-04 7:19
gldnrtvr15-Mar-04 7:19 
QuestionWhat does the error mean?? Pin
Prakash Nadar14-Mar-04 20:18
Prakash Nadar14-Mar-04 20:18 
AnswerRe: What does the error mean?? Pin
Michael Dunn15-Mar-04 4:17
sitebuilderMichael Dunn15-Mar-04 4:17 
GeneralRe: What does the error mean?? Pin
Prakash Nadar15-Mar-04 5:01
Prakash Nadar15-Mar-04 5:01 
GeneralWhere am i being downloaded from ?..... Pin
Monty214-Mar-04 18:18
Monty214-Mar-04 18:18 
GeneralRe: Where am i being downloaded from ?..... Pin
Michael Dunn15-Mar-04 4:24
sitebuilderMichael Dunn15-Mar-04 4:24 
GeneralATL, problem with RGS file, shell extension Pin
zilch14-Mar-04 13:19
zilch14-Mar-04 13:19 
Generalsome newbie questions.... Pin
rozbeh13-Mar-04 1:53
rozbeh13-Mar-04 1:53 
GeneralRe: some newbie questions.... Pin
Michael Dunn13-Mar-04 4:52
sitebuilderMichael Dunn13-Mar-04 4:52 
QuestionCan XML be used in a wtl project? Pin
freehawk12-Mar-04 20:46
freehawk12-Mar-04 20:46 
AnswerRe: Can XML be used in a wtl project? Pin
Prakash Nadar12-Mar-04 23:00
Prakash Nadar12-Mar-04 23:00 
QuestionWhat is the possible reason? Pin
freehawk10-Mar-04 22:55
freehawk10-Mar-04 22:55 
QuestionHow to insert/delete some content of text file fastly? Pin
freehawk10-Mar-04 20:23
freehawk10-Mar-04 20:23 
GeneralNewbie activex question Pin
Martin Walker10-Mar-04 3:19
Martin Walker10-Mar-04 3:19 
GeneralService problem. Pin
Prakash Nadar9-Mar-04 17:18
Prakash Nadar9-Mar-04 17:18 
QuestionHow to implement a MFC CFormView in WTL? Pin
Aizz9-Mar-04 14:59
Aizz9-Mar-04 14:59 

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.