I am trying to use the function HttpQueryInfo in WinInet to determine the length of a file in bytes. (The reason I need to do this is that I need to display a progress bar for the HTTP download and so need to know first the size of the file, so I can determine what percentage has been completed). I need this data (file size in bytes) as an Integer.
The function looks like this...
The code I've written so far is...
Buffer : DWORD;
BufferLength = 4; // 4 bytes
if HttpQueryInfo(hOpenURL, HTTP_QUERY_CONTENT_LENGTH or HTTP_QUERY_FLAG_NUMBER, @Buffer, @BufferSize, nil) = FALSE then // Unsuccessful else success and length will be in Buffer.
When I try to compile though I get an error message "Types of actual and formal var parameters must be identical". So it looks as though there is an error somewhere.
A couple of other things I am unsure about this function...
* What should I do with the last parameter? Is it sensible to pass nil or should I be passing something else?
* When used with asynchronous WinInet, will it ever call the callback with an INTERNET_REQUEST_STATUS_COMPLETE_MESSAGE? The reason I need to know is that any extra messages might have an impact on existing code.
Thanks in Advance,