Hey, wondered if someone could give me a bit of wisdom as to why my program compiles fine but crashes during use.
Its just a simple program with two edit controls. I enter text into edit control A and press the "submit" button and it reappears in edit control B. This works fine for string lengths up to 10 characters...why doesn't it work for longer strings?
It either stops responding, or just closes.
Code:
switch (wParam)
{
case SUBMIT:
{
LPSTR text;
DWORD nochars =GetWindowTextLength(EntryBoxA);
if (nochars != NULL)
{
GetWindowText(EntryBoxA, text,nochars+1);
SetWindowText(EntryBoxB, text); }
else
{
MessageBox(hwnd, "No Window Text Length!", "None", MB_OK | MB_ICONINFORMATION);
}
}
break;
default:
break;
}