Someone please tell me whats wrong with this bit of code- it compiles and runs, but it doesnt terminate properly. It still appears in task manager. It is definitely something to do with this bit.
Code:
LPWSTR output1 = pBuf->usri10_full_name;
LPWSTR output2 = pBuf->usri10_full_name;
int len1 = 0;
int len2 = 0;
int len = 0;
len1 = wcslen(output1);
len2 = wcslen(output2);
TCHAR buffer[20];
len = len1 +len2;
_itot(len,buffer,10);
MessageBox(NULL, buffer, NULL, NULL);
LPWSTR buf;
buf = new wchar_t [len];
LPWSTR o2 = wcscat(buf, output2);
o2 = wcscat(buf, output1);
MessageBox (NULL, W2T(o2), NULL, NULL);
delete [] buf;