Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Destructor Not Getting Called Pin
Mark Salsbery13-Apr-07 12:33
Mark Salsbery13-Apr-07 12:33 
AnswerRe: Destructor Not Getting Called Pin
John R. Shaw14-Apr-07 15:57
John R. Shaw14-Apr-07 15:57 
QuestionLogOff User from a Service running as System Pin
Gurkenscheibe13-Apr-07 10:44
Gurkenscheibe13-Apr-07 10:44 
Questionwhich one is parent? Pin
iayd13-Apr-07 9:02
iayd13-Apr-07 9:02 
AnswerRe: which one is parent? Pin
Wes Aday13-Apr-07 9:54
professionalWes Aday13-Apr-07 9:54 
QuestionRe: which one is parent? Pin
Maximilien13-Apr-07 9:56
Maximilien13-Apr-07 9:56 
AnswerRe: which one is parent? Pin
CPallini13-Apr-07 10:10
mveCPallini13-Apr-07 10:10 
AnswerRe: which one is parent? Pin
CPallini13-Apr-07 10:06
mveCPallini13-Apr-07 10:06 
You can make the three candidate parents to implement the same interface (pure abstract class) that defines a method returning some type info. For instance, Suppose you define IMyTypeInfo:
class IMyTypeInfo 
{
public:
  virtual int getType()=0;
}

then you can do something similar to:
class Dlg1 : public CDialog, public IMyTypeInfo
{
public:
 virtual int getType(){return 1;}
...
}


class Dlg2 : public CDialog, public IMyTypeInfo
{
public:
 virtual int getType(){return 2;}
...
}


class Dlg3 : public CDialog, public IMyTypeInfo
{
public:
 virtual int getType(){return 3;}
...
}


finally, you child dialog, can safely do the following cast:

int iType = ((IMyTypeInfo *)GetParent())->getType();


and retrieve parent's type.

(you can also go through RTTI...)

hope that helps.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

AnswerRe: which one is parent? Pin
bob1697213-Apr-07 10:10
bob1697213-Apr-07 10:10 
AnswerRe: which one is parent? Pin
JudyL_MD13-Apr-07 10:14
JudyL_MD13-Apr-07 10:14 
GeneralRe: which one is parent? Pin
iayd13-Apr-07 11:15
iayd13-Apr-07 11:15 
Questionhard disk serial number in vista Pin
viral_umang@hotmail.com13-Apr-07 8:59
viral_umang@hotmail.com13-Apr-07 8:59 
AnswerRe: hard disk serial number in vista Pin
bob1697213-Apr-07 9:58
bob1697213-Apr-07 9:58 
QuestionRe: hard disk serial number in vista Pin
viral_umang@hotmail.com13-Apr-07 10:16
viral_umang@hotmail.com13-Apr-07 10:16 
AnswerRe: hard disk serial number in vista Pin
bob1697213-Apr-07 10:45
bob1697213-Apr-07 10:45 
QuestionWhat happens if client CSocket does not process/clear returned package? Pin
zipliu13-Apr-07 5:04
zipliu13-Apr-07 5:04 
AnswerRe: What happens if client CSocket does not process/clear returned package? Pin
Mark Salsbery13-Apr-07 7:28
Mark Salsbery13-Apr-07 7:28 
GeneralRe: What happens if client CSocket does not process/clear returned package? Pin
zipliu13-Apr-07 9:03
zipliu13-Apr-07 9:03 
GeneralRe: What happens if client CSocket does not process/clear returned package? Pin
Mark Salsbery13-Apr-07 11:15
Mark Salsbery13-Apr-07 11:15 
GeneralRe: What happens if client CSocket does not process/clear returned package? Pin
zipliu13-Apr-07 9:04
zipliu13-Apr-07 9:04 
Questiongroup policy- pls help me Pin
deeps_cute13-Apr-07 5:02
deeps_cute13-Apr-07 5:02 
QuestionApply header programmatically Pin
Al_Pennyworth13-Apr-07 4:23
Al_Pennyworth13-Apr-07 4:23 
AnswerRe: Apply header programmatically Pin
Roger Stoltz13-Apr-07 4:44
Roger Stoltz13-Apr-07 4:44 
AnswerRe: Apply header programmatically Pin
Cedric Moonen13-Apr-07 4:50
Cedric Moonen13-Apr-07 4:50 
AnswerRe: Apply header programmatically Pin
krmed13-Apr-07 5:33
krmed13-Apr-07 5:33 

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.