I get a windows error message saying the proces has to end with this code:
Code:
void SendFile()
{
/*
LPOVERLAPPED overlapped;
overlapped->Offset = 0;
*/
LPTRANSMIT_FILE_BUFFERS buffers;
buffers->Head = "File";
buffers->HeadLength = sizeof("File");
MessageBox(NULL, "sdfds", "sdfsd", MB_OK);
HANDLE file = CreateFile("C:/Documents and Settings/Alex/Desktop/Lake.zip", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (file == INVALID_HANDLE_VALUE)
{
ApendText(textbox_status, "Error opening file");
ApendText(textbox_status, GetLastError());
}
if (TransmitFile(main_socket, file, NULL, NULL, NULL/*overlapped*/, buffers, NULL))
{
ApendText(textbox_status, "Transmiting file");
}
else
{
ApendText(textbox_status, "Error transmiting file");
ApendText(textbox_status, WSAGetLastError());
}
}
I figured out the error is when I declare LPTRANSMIT_FILE_BUFFERS buffers and try to fill it. I'm completely loss on how this is done, if I use . instead of-> I get error during compilertion.
If you need more info please ask.