Click here to Skip to main content
15,900,616 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: when does OnDraw Func. gets Called Pin
_AnsHUMAN_ 23-May-06 19:23
_AnsHUMAN_ 23-May-06 19:23 
GeneralRe: when does OnDraw Func. gets Called Pin
Steve Echols23-May-06 20:18
Steve Echols23-May-06 20:18 
QuestionFreeing the CObject Pin
pathakr23-May-06 19:14
pathakr23-May-06 19:14 
AnswerRe: Freeing the CObject Pin
Nibu babu thomas23-May-06 19:19
Nibu babu thomas23-May-06 19:19 
GeneralRe: Freeing the CObject Pin
pathakr23-May-06 19:25
pathakr23-May-06 19:25 
GeneralRe: Freeing the CObject Pin
Nibu babu thomas23-May-06 19:27
Nibu babu thomas23-May-06 19:27 
GeneralRe: Freeing the CObject Pin
pathakr23-May-06 19:38
pathakr23-May-06 19:38 
GeneralRe: Freeing the CObject Pin
Nibu babu thomas23-May-06 19:55
Nibu babu thomas23-May-06 19:55 
pathakr wrote:
Thanks Nibu.


You have to be careful here.

An example...

CAnotherObject anObject;
CObject *pToAnObject = &anObject; //pointer to anObject
 
//In this case don't delete just set to NULL. This will break the link between
//pToAnObject and anObject.
pToAnObject = NULL;


Another case...

CAnotherObject *anObject = new CAnotherObject;
CObject *pToAnObject = anObject; //pointer to anObject
 
//In this case you have to identify whose responsibility is it to <code>delete </code>the 
//object. Best would be to allow <code>anObject </code>to <code>delete </code>itself unless otherwise
//specified.
pToAnObject = NULL;
 
//delete anObject.
delete anObject;




Nibu thomas
A Developer

Programming tips[^]  My site[^]

GeneralRe: Freeing the CObject Pin
pathakr23-May-06 20:30
pathakr23-May-06 20:30 
QuestionNamespace Extensions and Handling F3/CTRL+F by our application Pin
Vasudevan Deepak Kumar23-May-06 19:03
Vasudevan Deepak Kumar23-May-06 19:03 
QuestionGradient RoundRect Pin
HakunaMatada23-May-06 18:56
HakunaMatada23-May-06 18:56 
AnswerRe: Gradient RoundRect Pin
Nibu babu thomas23-May-06 19:04
Nibu babu thomas23-May-06 19:04 
AnswerRe: Gradient RoundRect Pin
Hamid_RT23-May-06 19:18
Hamid_RT23-May-06 19:18 
Questioncontrolling the creation of objects Pin
kumar_mk23-May-06 18:47
kumar_mk23-May-06 18:47 
AnswerRe: controlling the creation of objects Pin
_AnsHUMAN_ 23-May-06 19:15
_AnsHUMAN_ 23-May-06 19:15 
AnswerRe: controlling the creation of objects Pin
Nibu babu thomas23-May-06 19:16
Nibu babu thomas23-May-06 19:16 
QuestionHow to Get Current System ip Pin
bujji_bec23-May-06 18:38
bujji_bec23-May-06 18:38 
AnswerRe: How to Get Current System ip [modified] Pin
Nibu babu thomas23-May-06 18:52
Nibu babu thomas23-May-06 18:52 
AnswerRe: How to Get Current System ip Pin
Hamid_RT23-May-06 19:03
Hamid_RT23-May-06 19:03 
QuestionMy Access DB Got Mad! Pin
Hamed Musavi23-May-06 18:21
Hamed Musavi23-May-06 18:21 
NewsC++ vs C# vs C++/CLI Performance [modified] Pin
Ed K23-May-06 17:08
Ed K23-May-06 17:08 
GeneralRe: C++ vs C# vs C++/CLI Performance [modified] Pin
bob1697223-May-06 17:36
bob1697223-May-06 17:36 
GeneralRe: C++ vs C# vs C++/CLI Performance [modified] Pin
Maxwell Chen23-May-06 18:06
Maxwell Chen23-May-06 18:06 
GeneralRe: C++ vs C# vs C++/CLI Performance [modified] Pin
Sarath C23-May-06 18:13
Sarath C23-May-06 18:13 
GeneralRe: C++ vs C# vs C++/CLI Performance [modified] Pin
Maxwell Chen23-May-06 18:21
Maxwell Chen23-May-06 18:21 

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.