"James Hawkins" truiken@gmail.com writes:
- do
- {
MultiByteToWideChar(CP_ACP, 0, ansi_list, len, ptr, len);
ansi_list += len;
ptr += len;
len = lstrlenA(ansi_list) + 1;
size += len * sizeof(WCHAR);
list = HeapReAlloc(GetProcessHeap(), 0, list, size);
- } while (*ansi_list);
You are assuming that A and W have the same length, that's wrong. Also it will be quite expensive to resize the list all the time. You should determine the full length of the list and then convert everything in one go.