If I compile under UNICODE compile option I can only get
InternetReadFileEx() to work if I "hardcode" to the ANSI Version thus:
char lpReadBuff[256];
INTERNET_BUFFERSA InetBuff;
FillMemory(&InetBuff, sizeof(InetBuff), 0);
InetBuff.dwStructSize = sizeof(InetBuff);
InetBuff.lpvBuffer = lpReadBuff;
InetBuff.dwBufferLength = sizeof(lpReadBuff) - 1;
err0=InternetReadFileExA( g_hRequest,
&InetBuff,
0,
(DWORD)p_rf);
this works returning 1 and accessing the callback function.
If I do:
TCHAR lpReadBuffT[256];
INTERNET_BUFFERS InetBuffX;
FillMemory(&InetBuffX, sizeof(INTERNET_BUFFERS), 0);
InetBuffX.dwStructSize = sizeof(INTERNET_BUFFERS);
InetBuffX.lpvBuffer = (LPVOID)lpReadBuffT;
InetBuffX.dwBufferLength = sizeof(lpReadBuffT) - 1;
err0=InternetReadFileEx( g_hRequest,
&InetBuffX,
0,
(DWORD)p_rf);
Then the function returns 0, the callback function isn't accessed and
GetLastError() gives:
120=INTERNET_STATUS_INTERMEDIATE_RESPONSE
If there isn't a ready fix, is it safe to stick with the ANSI version even
though the prog is compiled under UNICODE?
TIA
I remember that I met simular problem, and noticed that InternetReadFileExW
simply calls SetLastError to 120. After deep investigation I found that
functions body is simply:
.text:771F88D6 InternetWriteFileExW proc near
.text:771F88D6 push 78h ; InternetReadFileExW
.text:771F88D8 call ds:SetLastError
.text:771F88DE xor eax, eax
.text:771F88E0 retn 10h
.text:771F88E0 InternetWriteFileExW endp
--
Vladimir
"Fred" <n...@home.com> wrote in message
news:1u6dnf5yf8s...@pipex.net...
Thanks for the info. Spent a few hours trying to get it to work!
and no joking ;)