Hi,
In Dialog based MFC code (VC++ 2012), I have two command buttons and 1 Text Box
1. Enquire
2. Start
Once the user chooses ENQUIRE Button, I display msg in TextBox "Press START for the ....."
In the Start Button code, I do the socket opening,accept functions etc
while the Server is waiting for the client to get connected, I want continous "Waiting..." message to be dsiplayed
in the TextBox.
How to get this displayed? Below is section of code where i want the msg to be displayed.
*
So when before accept(), i want the WAITING Msg text to be displayed.
Thanks..
Anu
void CAbtDlg::OnBnClickedStart()
{
myport = 200;
SOCKADDR_in socketaddress;
socketaddress.sin_family = PF_INET;
socketaddress.sin_prt = htons((u_short)myport);
socketaddress.sin_addr.s_addr = INADDR_ANY;
idc_txtbox.put_Text("Waiting.....");// I tied this too didnt work
SetDlgItemTextA("Waiting...");//This too fails
csocket = accept(s_socket,NULL,NULL);
if(csocket==INVALID_SOCKET)
{
MessageBox("Socket error",MB_OK);
closesocket(s_socket);
}
//do the other functions
/*I read the data from text file and then put the data in variabale "UserIdent"
once the whole file is read, i display the actual data in the text box */
idc_txtbox.put_Text(UserIdent); // This works..
/*so i between when the file is fetched for reading, the textbox is blank (i want to notify the end user with a wait message). This is my requirement.*/
}