Re: question concerning pointer to CFormView
oops, forgot the code. Here it is.
Z.K.
code:
void CTravelerView::OnInitialUpdate()
{
m_OptionsChanged = 1;
m_OptionsSaved = 0;
}
void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
CTravelerView *pForm = (CTravelerView *)AfxGetApp();
CString temp;
temp.Format("pForm->m_OptionsChanged = %d\npForm->m_OptionsSaved =
%d",pForm->m_OptionsChanged,pForm->m_OptionsSaved);
MessageBox(temp);
CFrameWnd::OnClose();
}
"Z.K." <nospam@nospam.net> wrote in message news:...
I have an application and I wanted to pop up a message box depending on the
value of a variable in the CFormView when the x is clicked on the titlebar.
I created a pointer to the CFormView from CMainFrm, but it always displays
the variables as 0 and not what I changed them to in OnInitialUpdate. I am
not really sure why this does not work, but I have posted the code below if
someone could tell me what I am doing wrong.
Z.K.