Код писал(а):var
BufferLen: DWORD;
...
begin
...
InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen);
Компилятор писал(а):unit1.pas(80,66) Error: Incompatible type for arg no. 4: Got "LongWord", expected "LPDWORD"
Модератор: Модераторы
Код писал(а):var
BufferLen: DWORD;
...
begin
...
InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen);
Компилятор писал(а):unit1.pas(80,66) Error: Incompatible type for arg no. 4: Got "LongWord", expected "LPDWORD"
Но в чем очевидность и зачем этот знак "@"
type
...
LPDWORD = ^DWORD;
...
{$IFDEF WINCE}
hSession:= InternetOpen(PWideChar(sAppName), INTERNET_OPEN_TYPE_PRECONFIG,nil, nil, 0);
try
hURL := InternetOpenURL(hSession,PWideChar(fileURL),nil,0,0,0);
try
Stream.Clear;
repeat
InternetReadFileEx(hURL, @Buffer, SizeOf(Buffer), BufferLen);
Stream.Write(Buffer,BufferLen);
until BufferLen = 0;
finally
InternetCloseHandle(hURL)
end;
finally
InternetCloseHandle(hSession)
end;
{$ENDIF}
{$IFDEF WIN32}
hSession:= InternetOpen(PChar(sAppName), INTERNET_OPEN_TYPE_PRECONFIG,nil, nil, 0);
try
hURL := InternetOpenURL(hSession,PChar(fileURL),nil,0,0,0);
try
Stream.Clear;
repeat
InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen);
Stream.Write(Buffer,BufferLen);
until BufferLen = 0;
finally
InternetCloseHandle(hURL)
end;
finally
InternetCloseHandle(hSession)
end;
{$ENDIF}
Call InternetCanonicalizeUrl first if the URL being used contains a relative URL and a base URL separated by blank spaces.
To retrieve a specific error message, call GetLastError. To determine why access to the service was denied, call InternetGetLastResponseInfo.
Вернуться в Обучение Free Pascal
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4