the double casting worked, you are great!
i still couldnt apply that to swprintf though :s but this is what i have so far:
name_len - 3 is the number of bytes, including the null termintor that the string goes for.
Code:
here is a byte printout of the array, (starting at payload[0])
0x82 0x00 0xD6 0x01 0x00 0x13 0x00 0x6C 0x00 0x6F 0x00 0x6C 0x00 0x2E 0x00 0x74 0x00 0x78 0x00 0x74 0x00 0x00
-- start of filename field 2 byte null(end)
wchar_t * file_name[200];
for(i = 0 ; i < name_len-3 ; i++){
wprintf(L"%C",(wchar_t *)((u8_t *)p->payload)[i+6]); //works
swprintf(&file_name[i], name_len-3 ,L"%C",(wchar_t *)((u8_t *)p->payload)[i+6]); //dosent work...
}
wprintf(L"%S",file_name); //dosent work
thanks!