Click here to Skip to main content
15,896,727 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: accessing parent variables from dialog mfc?? Pin
led mike17-Apr-07 11:36
led mike17-Apr-07 11:36 
GeneralRe: accessing parent variables from dialog mfc?? Pin
bimgot17-Apr-07 12:07
bimgot17-Apr-07 12:07 
QuestionRe: accessing parent variables from dialog mfc?? Pin
David Crow17-Apr-07 16:43
David Crow17-Apr-07 16:43 
AnswerRe: accessing parent variables from dialog mfc?? Pin
bimgot18-Apr-07 0:36
bimgot18-Apr-07 0:36 
GeneralRe: accessing parent variables from dialog mfc?? Pin
JudyL_MD18-Apr-07 2:39
JudyL_MD18-Apr-07 2:39 
GeneralRe: accessing parent variables from dialog mfc?? Pin
David Crow18-Apr-07 2:46
David Crow18-Apr-07 2:46 
GeneralRe: accessing parent variables from dialog mfc?? Pin
bimgot18-Apr-07 3:25
bimgot18-Apr-07 3:25 
GeneralRe: accessing parent variables from dialog mfc?? Pin
David Crow18-Apr-07 2:51
David Crow18-Apr-07 2:51 
How does this answer the question, "Does GetParent() return the correct parent address?"

void CDlg::OnTimer(UINT_PTR nIDEvent)
{
    CDialog::OnTimer(nIDEvent);
    dlg_level = dlg_sldr.GetPos();
 
    CformView* form = (CformView*) GetParent();
    // what is the value of 'form' here?
    form->form_level = dlg_level;
    form->UpdateData(TRUE);
 
    UpdateData(TRUE);
}
 
void CformView::OnViewDlg()
{ 
    CDlg dialog;
    // what is the value of the 'this' pointer here?
    dialog.dlg_level = form_sldr.GetPos();
    dialog.DoModal();
}
Since CDlg is a modal dialog, I question whether this will even work, since messages sent to its parent will be blocked until DoModal() returns.


"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


GeneralRe: accessing parent variables from dialog mfc?? Pin
bimgot18-Apr-07 3:48
bimgot18-Apr-07 3:48 
QuestionRe: accessing parent variables from dialog mfc?? Pin
David Crow18-Apr-07 3:59
David Crow18-Apr-07 3:59 
AnswerRe: accessing parent variables from dialog mfc?? Pin
bimgot18-Apr-07 5:21
bimgot18-Apr-07 5:21 
GeneralRe: accessing parent variables from dialog mfc?? Pin
David Crow18-Apr-07 5:25
David Crow18-Apr-07 5:25 
GeneralRe: accessing parent variables from dialog mfc?? Pin
bimgot18-Apr-07 5:30
bimgot18-Apr-07 5:30 
QuestionVC++ Class Diagram resolution. Pin
oleg6317-Apr-07 10:08
professionaloleg6317-Apr-07 10:08 
QuestionHelp Pin
tanchinchee17-Apr-07 7:01
tanchinchee17-Apr-07 7:01 
AnswerRe: Help Pin
Arman S.17-Apr-07 7:19
Arman S.17-Apr-07 7:19 
GeneralRe: Help Pin
tanchinchee17-Apr-07 7:24
tanchinchee17-Apr-07 7:24 
QuestionRe: Help Pin
sthotakura17-Apr-07 7:45
sthotakura17-Apr-07 7:45 
AnswerRe: Help Pin
tanchinchee17-Apr-07 7:51
tanchinchee17-Apr-07 7:51 
GeneralRe: Help Pin
David Crow17-Apr-07 7:50
David Crow17-Apr-07 7:50 
GeneralRe: Help Pin
tanchinchee17-Apr-07 7:56
tanchinchee17-Apr-07 7:56 
AnswerRe: Help Pin
Maximilien17-Apr-07 7:23
Maximilien17-Apr-07 7:23 
GeneralRe: Help Pin
tanchinchee17-Apr-07 7:27
tanchinchee17-Apr-07 7:27 
QuestionRe: Help Pin
David Crow17-Apr-07 7:51
David Crow17-Apr-07 7:51 
AnswerRe: Help Pin
tanchinchee17-Apr-07 8:01
tanchinchee17-Apr-07 8:01 

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.