Enno Kolb
2004-11-12 14:19:01 UTC
Hello,
i'm downloading a XML-file with InternetReadFile (see code snippet below).
With files bigger than arround 20kb InternetReadFile fails sporadically
after it downloaded a few kilobytes of the file successfully. GetLastError
returns 183 (ERROR_ALREADY_EXISTS). My system is running Windows 2000 SP4
with IE 6.0SP1.
What does this error code mean in this context?
Thanks,
Enno
Code spnippet:
#define MAX_STREAMBUFFERSIZE 2048
long FileSize = 0;
CString XMLResponseBuffer;
BYTE StreamBuffer[MAX_STREAMBUFFERSIZE];
ULONG cbToRead = MAX_STREAMBUFFERSIZE;
ULONG cbRead = 0;
do
{
//Datenstrom auslesen
if(InternetReadFile(hRequest, StreamBuffer, cbToRead-1, &cbRead)==FALSE)
{
m_XMLOnlineProtocol->WriteLine("InternetReadFile error : %d",
GetLastError());
m_ErrorFlag = true;
goto READXMLCONTENT_END;
}
StreamBuffer[cbRead] = 0x00;
//Gesamtfilegrösse ermitteln
FileSize += cbRead;
//Buffer in die Datei schreiben
XMLResponseBuffer += StreamBuffer;
} while(cbRead > 0);
i'm downloading a XML-file with InternetReadFile (see code snippet below).
With files bigger than arround 20kb InternetReadFile fails sporadically
after it downloaded a few kilobytes of the file successfully. GetLastError
returns 183 (ERROR_ALREADY_EXISTS). My system is running Windows 2000 SP4
with IE 6.0SP1.
What does this error code mean in this context?
Thanks,
Enno
Code spnippet:
#define MAX_STREAMBUFFERSIZE 2048
long FileSize = 0;
CString XMLResponseBuffer;
BYTE StreamBuffer[MAX_STREAMBUFFERSIZE];
ULONG cbToRead = MAX_STREAMBUFFERSIZE;
ULONG cbRead = 0;
do
{
//Datenstrom auslesen
if(InternetReadFile(hRequest, StreamBuffer, cbToRead-1, &cbRead)==FALSE)
{
m_XMLOnlineProtocol->WriteLine("InternetReadFile error : %d",
GetLastError());
m_ErrorFlag = true;
goto READXMLCONTENT_END;
}
StreamBuffer[cbRead] = 0x00;
//Gesamtfilegrösse ermitteln
FileSize += cbRead;
//Buffer in die Datei schreiben
XMLResponseBuffer += StreamBuffer;
} while(cbRead > 0);