In the interests of berevity, I'm only posting the code inside of the case: break;.
The problem is that when I have text in my edit control with a newline (\r\n as Windows defines it), the program exits. I can't figure out how to handle this.
int length = GetWindowTextLength(GetDlgItem(hWnd, ID_EDIT));
if (length > 0)
char *temp = new char;
GetDlgItemText(hWnd, ID_EDIT, temp, length+1);
s += "/* Long string */";
SetDlgItemText(hWnd, ID_EDIT, s.c_str());
SetDlgItemText(hWnd, ID_EDIT, "/* Long string */");
For example, you have text like:
Thank you in advance.