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

C / C++ / MFC

 
QuestionMedia Player mobile Pin
Mohammad A Gdeisat16-Aug-06 22:36
Mohammad A Gdeisat16-Aug-06 22:36 
AnswerRe: Media Player mobile Pin
ThatsAlok17-Aug-06 0:02
ThatsAlok17-Aug-06 0:02 
GeneralRe: Media Player mobile Pin
Mohammad A Gdeisat17-Aug-06 0:17
Mohammad A Gdeisat17-Aug-06 0:17 
GeneralRe: Media Player mobile Pin
ThatsAlok17-Aug-06 1:17
ThatsAlok17-Aug-06 1:17 
GeneralRe: Media Player mobile Pin
Mohammad A Gdeisat17-Aug-06 4:26
Mohammad A Gdeisat17-Aug-06 4:26 
GeneralRe: Media Player mobile Pin
ThatsAlok17-Aug-06 18:23
ThatsAlok17-Aug-06 18:23 
GeneralRe: Media Player mobile Pin
Mohammad A Gdeisat17-Aug-06 22:17
Mohammad A Gdeisat17-Aug-06 22:17 
Question[Message Deleted] Pin
manosza16-Aug-06 21:53
manosza16-Aug-06 21:53 
AnswerRe: New Forum for Windows Pin
Sarath C16-Aug-06 22:03
Sarath C16-Aug-06 22:03 
AnswerRe: New Forum for Windows Pin
Hamid_RT16-Aug-06 22:16
Hamid_RT16-Aug-06 22:16 
AnswerRe: New Forum for Windows Pin
toxcct16-Aug-06 22:52
toxcct16-Aug-06 22:52 
GeneralRe: New Forum for Windows Pin
Hamid_RT16-Aug-06 23:46
Hamid_RT16-Aug-06 23:46 
AnswerRe: New Forum for Windows Pin
ThatsAlok17-Aug-06 0:03
ThatsAlok17-Aug-06 0:03 
Questionsetting xml namespace Pin
harilal16-Aug-06 20:44
harilal16-Aug-06 20:44 
AnswerRe: setting xml namespace Pin
ThatsAlok17-Aug-06 0:05
ThatsAlok17-Aug-06 0:05 
GeneralRe: setting xml namespace Pin
harilal17-Aug-06 3:10
harilal17-Aug-06 3:10 
Questionabout use cunibutton and load the background bitmap Pin
sdhtyjnniutnbjnhbghb16-Aug-06 19:41
sdhtyjnniutnbjnhbghb16-Aug-06 19:41 
AnswerRe: about use cunibutton and load the background bitmap Pin
Hamid_RT16-Aug-06 22:16
Hamid_RT16-Aug-06 22:16 
QuestionSetFocus() Pin
SandhyaSri16-Aug-06 19:26
SandhyaSri16-Aug-06 19:26 
AnswerRe: SetFocus() Pin
sunit516-Aug-06 19:28
sunit516-Aug-06 19:28 
GeneralRe: SetFocus() Pin
prasad_som16-Aug-06 19:52
prasad_som16-Aug-06 19:52 
GeneralRe: SetFocus() Pin
SandhyaSri16-Aug-06 21:32
SandhyaSri16-Aug-06 21:32 
GeneralRe: SetFocus() Pin
prasad_som16-Aug-06 22:46
prasad_som16-Aug-06 22:46 
AnswerRe: SetFocus() Pin
Stephen Hewitt16-Aug-06 21:11
Stephen Hewitt16-Aug-06 21:11 
GeneralRe: SetFocus() Pin
SandhyaSri16-Aug-06 21:31
SandhyaSri16-Aug-06 21:31 
Actually I am using the PropertySheets.In one of the propertyPage I have some edit controls.For each edit control there is some validation.I have handled these validations in the respective editcontrol's EN_KILLFOCUS event.

For one of the edit boxes the code is as follows:

void CMyFile::OnKillfocusEditRange()
{


CWnd *cwnd=GetFocus();
if(cwnd->GetDlgCtrlID() == IDCANCEL)
return;

else
CheckRanges(IDC_EDIT_RANGE);

}
void CMyFile::CheckRanges(int intID)
{
CString str;
double d1;
GetDlgItemText(intID,str);
d1=_tcstod(str,NULL);
if(d1 > 5 || d1< -5)
{

AfxMessageBox(_T("Range should be in 5 and -5");
pEdit = (CEdit *)GetDlgItem(intID);
pEdit->SetFocus();


}


}

I am doing the same checking even in the OnApply() .(After setfocus I return FALSE otherwise I return "return CPropertyPage::OnApply(); "

After running the application and when the message "Range should be in 5 and -5" is raised ,after clicking the Ok button of the AfxMessageBox ,if I move the cursor to open some other application there is a crash as "the memory cannot be read"



Sandhya

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.