ReadFile writes the content of a contiguous buffer. So you need to specify the start of the buffer and its length.
You can pass WCHAR* in, but you need to remember that WCHAR is two bytes, so you must use that to multiply the string length when passed to ReadFile/WriteFile, send/recv, sendto/recvfrom, ...
I need to set the contents of an edit box with the text I read from the file.
GetFileSize returns the number of bytes in a file. Wouldn't you be reading past the contents of the file if you multiply the number of the bytes to read by 2 like this?
ReadFile(hFile, pszText, size*2, &read, 0);
What if I just used this instead of WCHARS, would it work with unicode too?
The edit box was created with CreateWindowExW and I'm using SendMessage instead of SetWindowText since SetWindowText accepts only a buffer of signed CHARS