InternetWriteFile(....

I am trying uploading files by using InterWriteFile function like this blow.
InternetWriteFile(hFile, lpBuffer, dwNumberOfBytesToWrite, lpdwNumberOfBytesWritten)

And I want to cathch how many butes being uploaded, which is last param
lpdwNumberOfBytesWritten, I think.

So, I did it like this.
DWORD dwWritten;.....
InternetWriteFile(hCon, buf, 1000, &dwWritten);
However, I found out dwWritten is always 0.
what's the problem??
Any ideas? Thanks.
According to http://msdn.microsoft.com/en-us/library/windows/desktop/aa385128(v=vs.85).aspx , you must set dwWritten to zero before calling the function. Are you doing that?

Also make sure you call GetLastError() and FormatMessage() if the function is returning FALSE so you get an idea of why the call fails.
I got it. Thanks.
Topic archived. No new replies allowed.