I can't copy the contents of an array to another array in struct

Hi I have struct

1
2
3
4
struct sFile{
WCHAR filename[256]
WCHAR path[32727]
};


I get file and path with OPENFILENAME and GetOpenFileName(&ofn)

I have buffers variable:
1
2
3
WCHAR filenamebuf[256];
WCHAR pathbuf[32727];
//buffer to send filename and path from OPENFILENAME 


I test this buffer and is ok the filename and path is OK

and...

sFile fileTemp;

1
2
3
4
5
ZeroMemory(&fileTemp,sizeof(fileTemp));

wcscat(fileTemp.filename,filenamebuf); //AND fileTemp.filename is empty
wcsncpy(fileTemp.filename,filenamebuf,256); //AND fileTemp.filename is empty
memcpy(fileTemp.filename,filenamebuf,sizeof(filenamebuf)); //AND fileTemp.filename is empty 


What I'm doing wrong??

EDITED****
wcscat(fileTemp.filename,"KKKKKKKK"); //fileTemp.filename is empty!!!

I'm irritable
Last edited on
Topic archived. No new replies allowed.