Hi all
I have stranger problem in dialog box Control disappear from dialog.There is no issue of memory and cpu uses,both are normal.I want to know what reason behind this situation?
Please help me..
Printable View
Hi all
I have stranger problem in dialog box Control disappear from dialog.There is no issue of memory and cpu uses,both are normal.I want to know what reason behind this situation?
Please help me..
And I have strange problem the left head light of my car sometimes disappears. There is no issue of accu battery and engine uses,both are normal.I want to know what reason behind this situation?
Please help me..
:rolleyes:
Imagine you go to a doctor and say: "Doc, I'm sick. I want to know why." What answer do you think you'll get?
Please explain what control, when does it disappear, etc. etc. Someone is probably hiding the control.
Sorry
I have a dialog A and modless dialog B.Modless Dialog B call on button click of Dialog A.I use timer to show Watch in Modless dialog B.When i set time for One hour then this thing is happen.Conrtols are Button,Check Box,Static Box from Main Dialog A.
Code:
extern CStatic m_settime;
CdialogADlg* test;
void CdialogADlg::OnBnClickedCall()
{
m_dialogB= new CdialogB(test);
m_dialogB->Create(CdialogB::IDD,0);
m_dialogB->CenterWindow(test);
m_dialogB->ShowWindow(SW_SHOW);
SetTimer(1,1000,0);
}
//Timer
void CdialogADlg::OnTimer(UINT_PTR nIDEvent)
{
if(nIDEvent==1)
{
m_settime.SetWindowText("Time start.");
}
CDialog::OnTimer(nIDEvent);
}
Very bad design.
Very bad code.
Don't touch any control of the dialog B from outside the dialog B.
Move OnTime() message handler from dialog A to dialog B.
Move SetTimer from dialog A to OnInitDialog method of the dialog B.
Besides:
1. your CdialogADlg* test; is not used, so why do you show it?
2. I don't see any place where youQuote:
Originally Posted by Msm
In addition to what Victor said, when you use timers, catch the value returned by the SetTimer, that is the actual timer ID, not necessarily the value you passed as argument to SetTimer. In OnTimer, check the value of nIDEvent against it.
Code:m_timerID = SetTimer(1,1000,0); // m_timerID is a member of CSomeDialog
void CSomeDialog::OnTimer(UINT_PTR nIDEvent)
{
if(nIDEvent==m_timerID)
{
}
CDialog::OnTimer(nIDEvent);
}
Thanks to all problem solved.