Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: delete in ctor ! Pin
Roger Stoltz2-Jun-06 5:42
Roger Stoltz2-Jun-06 5:42 
GeneralRe: delete in ctor ! Pin
Chris Losinger2-Jun-06 5:48
professionalChris Losinger2-Jun-06 5:48 
GeneralRe: delete in ctor ! Pin
Roger Stoltz2-Jun-06 6:16
Roger Stoltz2-Jun-06 6:16 
GeneralRe: delete in ctor ! Pin
Nemanja Trifunovic2-Jun-06 5:05
Nemanja Trifunovic2-Jun-06 5:05 
AnswerRe: delete in ctor ! Pin
BadKarma2-Jun-06 3:15
BadKarma2-Jun-06 3:15 
GeneralRe: delete in ctor ! Pin
toxcct2-Jun-06 3:35
toxcct2-Jun-06 3:35 
GeneralRe: delete in ctor ! Pin
Zac Howland2-Jun-06 3:47
Zac Howland2-Jun-06 3:47 
GeneralRe: delete in ctor ! Pin
Roger Stoltz2-Jun-06 4:23
Roger Stoltz2-Jun-06 4:23 
Zac Howland wrote:
As a side note, the code written in the original post should NEVER be used in any real code. Use a constructor for what it is meant for; the same goes for destructors. Making these functions do things contrary to general practice serves no purpose.


Absolutely.
Otherwise the code be hard to use, maintain and even understand.
What should be done in this case, since the OP wants to gain control over objects created on the heap, is to override the new operator.

--
Roger


It's supposed to be hard, otherwise anybody could do it!

Regarding CodeProject: "resistance is pointless; you will be assimilated"

GeneralRe: delete in ctor ! Pin
BadKarma2-Jun-06 4:32
BadKarma2-Jun-06 4:32 
GeneralRe: delete in ctor ! Pin
Roger Stoltz2-Jun-06 4:38
Roger Stoltz2-Jun-06 4:38 
GeneralRe: delete in ctor ! Pin
Zac Howland2-Jun-06 5:04
Zac Howland2-Jun-06 5:04 
JokeRe: delete in ctor ! Pin
BadKarma2-Jun-06 5:13
BadKarma2-Jun-06 5:13 
QuestionMigrating from VC6 to VS2005 [modified] Pin
Obliterator2-Jun-06 1:36
Obliterator2-Jun-06 1:36 
AnswerRe: Migrating from VC6 to VS2005 [modified] Pin
Chris Losinger2-Jun-06 1:58
professionalChris Losinger2-Jun-06 1:58 
GeneralRe: Migrating from VC6 to VS2005 [modified] Pin
Obliterator2-Jun-06 2:17
Obliterator2-Jun-06 2:17 
AnswerRe: Migrating from VC6 to VS2005 Pin
Michael Dunn2-Jun-06 7:46
sitebuilderMichael Dunn2-Jun-06 7:46 
GeneralRe: Migrating from VC6 to VS2005 Pin
Obliterator9-Jun-06 2:33
Obliterator9-Jun-06 2:33 
QuestionRight way to delete a pointer Pin
zahid_ash2-Jun-06 1:31
zahid_ash2-Jun-06 1:31 
AnswerRe: Right way to delete a pointer Pin
Cedric Moonen2-Jun-06 1:40
Cedric Moonen2-Jun-06 1:40 
AnswerRe: Right way to delete a pointer Pin
Amar Sutar2-Jun-06 1:41
Amar Sutar2-Jun-06 1:41 
GeneralRe: Right way to delete a pointer [modified] Pin
Viorel.2-Jun-06 2:14
Viorel.2-Jun-06 2:14 
GeneralRe: Right way to delete a pointer [modified] Pin
Zac Howland2-Jun-06 3:50
Zac Howland2-Jun-06 3:50 
GeneralRe: Right way to delete a pointer [modified] Pin
Nish Nishant2-Jun-06 3:54
sitebuilderNish Nishant2-Jun-06 3:54 
GeneralRe: Right way to delete a pointer [modified] Pin
Zac Howland2-Jun-06 4:58
Zac Howland2-Jun-06 4:58 
GeneralRe: Right way to delete a pointer [modified] Pin
Nemanja Trifunovic2-Jun-06 6:17
Nemanja Trifunovic2-Jun-06 6:17 

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.