i found out what the problem was: i had to use double slashes ( \\ ).
here's the SendFile and recv code:
HANDLE hnd = CreateFile("D:\\aaa.txt", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hnd == INVALID_HANDLE_VALUE)
cout<<"error => "<<GetLastError()<<endl;
bool ret = TransmitFile(newConn, hnd, GetFileSize(hnd, NULL), 1, NULL, NULL, 0);
the problem is that everytime i get only part of the text in the file (each time different size of text).
if(recv(sockfd, buf, 1, 0) > 0)
i heard that send() sometimes doesn't send all data, but TransmitFile has the same problem?