i hab made a dialog box/form in vc++ MFC which should take the inputs from user(username,password)and if the username ,password is correct it shows the message connecting in another form,and if the inputs are not correct the form should not close. my code is below:
void LoginCredentials::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
if (UpdateData(TRUE))
{
this->ShowWindow(FALSE);
}
else
{
this->ShowWindow(TRUE);
}
}
but even if the inputs are incorrect,form gets closed..can anybody help me or suggest me,any kind of help will be appreciated.
Errr I don't think UpdateData() is used like that...
Your OnBnClickedOk() should test whether the user has input the correct data (by checking what the controls have with the GetWindowText() method for example). And thennnnnn do your ShowWindow(). But, not by testing UpdateData() because that doenst make any sense..