On 13.06.2015 12:41, Alistair Leslie-Hughes wrote:
- ret = SQLGetPrivateProfileStringW(sect, entry, string, retval, cbRetBuffer, file);
- if(ret)
- {
int i, len;
len = ret < cbRetBuffer ? ret : cbRetBuffer;
for (i=0; i < len; i++)
RetBuffer[i] = retval[i];
RetBuffer[i] = 0;
- }
You can't convert it like that, the idea is to do A->W conversion for inputs and W->A for output. Inputs are handled by heap_strdupAtoW(), so you need a single WideCharToMultiByte for retbuffer.