I am making a network application and am having some problems. I have a function that asks for username/pass and is suppose to activate a set of buttons on successful logon, however it's not working. (Logging on requires the user to press the logon button named IDC_BLOGON and then another dialog pops up and presets the user w/ username/password edit boxes. After putting the username/pass in the user presses OK) It seems that whenever I "logon" the buttons don't enable. After further study it seems that the program is reading the buffer BEFORE the command instead of after. I'm not sure why this is, or how to correct it. Below is a snippit of code to give you an idea of what I am working with. Help please.... :) Thank you for taking time to read this even if you can't help! :)
void CSockDlg::OnBlogon()
{
//Open Dialog Box for geting username and password
if (m_dLogon.DoModal () ==IDOK)
{
//Making the command string
m_strCommand = "slogin ";
m_strCommand += m_dLogon.m_strUsername;
m_strCommand += " ";
m_strCommand += m_dLogon.m_strPassword;
//Sending the command
CSockDlg::Send();
}
//Check to see if the logon was a success
if (m_strOutput == "OK\r\n")
{
//Logon was a success enable buttons
GetDlgItem(IDC_BCHANLIST)->EnableWindow(TRUE);
GetDlgItem(IDC_BUSERLIST)->EnableWindow(TRUE);
}
else
{
//Logon failed
MessageBox(m_strOutput, "ERROR");
}
}