Click here to Skip to main content
15,890,947 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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

GeneralRe: SetFocus() Pin
Stephen Hewitt16-Aug-06 21:50
Stephen Hewitt16-Aug-06 21:50 
GeneralRe: SetFocus() Pin
Hamid_RT16-Aug-06 22:19
Hamid_RT16-Aug-06 22:19 
AnswerRe: SetFocus() Pin
Mircea Puiu16-Aug-06 22:55
Mircea Puiu16-Aug-06 22:55 
General[OT] Pin
toxcct16-Aug-06 23:34
toxcct16-Aug-06 23:34 
GeneralRe: [OT] Pin
Mircea Puiu17-Aug-06 0:39
Mircea Puiu17-Aug-06 0:39 
GeneralRe: [OT] Pin
ThatsAlok17-Aug-06 2:09
ThatsAlok17-Aug-06 2:09 
GeneralRe: [OT] Pin
Mircea Puiu17-Aug-06 4:20
Mircea Puiu17-Aug-06 4:20 
Questionproblem with FTP client[modified] Pin
vijay_aroli16-Aug-06 18:28
vijay_aroli16-Aug-06 18:28 
AnswerRe: problem with FTP client[modified] Pin
Divyang Mithaiwala16-Aug-06 19:57
Divyang Mithaiwala16-Aug-06 19:57 
GeneralRe: problem with FTP client[modified] Pin
vijay_aroli16-Aug-06 20:17
vijay_aroli16-Aug-06 20:17 
GeneralRe: problem with FTP client[modified] Pin
vijay_aroli16-Aug-06 21:07
vijay_aroli16-Aug-06 21:07 
Questionwhat went wrong?in this code [modified] Pin
With_problem16-Aug-06 18:08
With_problem16-Aug-06 18:08 
AnswerRe: what went wrong?in this code Pin
Hamid_RT16-Aug-06 22:20
Hamid_RT16-Aug-06 22:20 
GeneralRe: what went wrong?in this code Pin
Sarath C16-Aug-06 22:38
Sarath C16-Aug-06 22:38 
GeneralRe: what went wrong?in this code Pin
Hamid_RT16-Aug-06 23:46
Hamid_RT16-Aug-06 23:46 
GeneralRe: what went wrong?in this code Pin
Sarath C17-Aug-06 0:15
Sarath C17-Aug-06 0:15 
AnswerRe: what went wrong?in this code Pin
Sarath C16-Aug-06 22:36
Sarath C16-Aug-06 22:36 

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.