Beginner needs help with edit control

I am very new to C++. I have been messing around with Visual C++ Express for a little bit. Right now I have a window created. When the user clicks a button, a dialog opens with two edit controls and a button. At the moment I just have it so when the button is pushed, the text that has been inputted into one edit box is sent to the second. I want to now compare the text in the edit control with a specific word, and if they match, then put that text in the other text box.

Here's my code so far:

INT_PTR CALLBACK Dialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
return (INT_PTR)TRUE;

if (LOWORD(wParam) == IDCANCEL)
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
else if (LOWORD(wParam) == IDOK)
wchar_t buffer[MAX_PATH+1];
memset(&buffer, 0, sizeof(buffer));
GetDlgItemText(hDlg, IDC_EDIT1, buffer, MAX_PATH+1);
SetDlgItemText(hDlg, IDC_EDIT2, buffer);
return (INT_PTR)FALSE;

Can anyone tell me how to compare the text of the edit control with a specific string?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!