Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HttpQueryInfo (WinInet)

51 views
Skip to first unread message

Budiw

unread,
Nov 5, 1999, 3:00:00 AM11/5/99
to
How to Fix Error Below ?

Error: Types of actual and formal var parameters must be identical

MyCode:

=======================================
procedure TForm2.Button1Click(Sender: TObject);
var
hHttpSession, hReqUrl, hQueryInfo: HInternet;
Buffer: Array[0..Pred(BufferSize)] of Byte;
BufferLength: DWORD;
nRead: Cardinal;
strRead: string;
begin
hHttpSession := InternetOpen ('MyHTTPSProbe',
INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
try
hReqUrl := InternetOpenURL (hHttpSession, PChar(StrUrl), nil, 0,0,0);
strStatus := 'Connected to ' + StrUrl;
hQueryInfo:=HttpQueryInfo(hReqUrl, HTTP_QUERY_STATUS_CODE,
@Buffer, sizeof(Buffer), nil);
finally
InternetCloseHandle (hReqUrl);
end;
InternetCloseHandle (hHttpSession);
end;


Bob Dellaca

unread,
Nov 6, 1999, 3:00:00 AM11/6/99
to
The 4th and 5th parameters for HttpQueryInfo must be variables: e.g.

var
BufferLength: DWORD;
Reserved: DWORD;
begin
...
BufferLength := sizeof(Buffer);
Reserved := 0;
HttpQueryInfo(..; ..; ..; BufferLength; Reserved);


Budiw

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
Error Message:
Incompatible Types: 'LongBool' and 'Pointer'

MyCode:
----------------------------------------------------------------------

procedure TForm2.Button1Click(Sender: TObject);
const
buffersize = 1024;


var
hHttpSession, hReqUrl, hQueryInfo: HInternet;

buffer: Array[0..Pred(BufferSize)] of DWORD;
length_buffer: DWORD; // length of content
reserved: DWORD;


nRead: Cardinal;
strRead: string;
begin
hHttpSession := InternetOpen ('MyHTTPSProbe',
INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
try
hReqUrl := InternetOpenURL (hHttpSession, PChar(StrUrl), nil, 0,0,0);
strStatus := 'Connected to ' + StrUrl;

length_buffer := sizeof(buffer);
reserved := 0;
hQueryInfo:=HttpQueryInfo(hReqUrl, HTTP_QUERY_STATUS_CODE,
@buffer, length_buffer, reserved);


finally
InternetCloseHandle (hReqUrl);
end;
InternetCloseHandle (hHttpSession);
end;

Bob Dellaca wrote in message <382366ac...@forums.inprise.com>...

Bob Dellaca

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
The function result for HttpQueryInfo is BOOL. not HInternet. Thus you
could write, for example:

if HttpQueryInfo(hReqUrl, HTTP_QUERY_STATUS_CODE,
@buffer, length_buffer, reserved) then
...

If you like, I can email you a copy of the documentation I have for
WinInet, a Word file from MS called inetref.doc (email me direct).

Cheers,
Bob Dellaca

0 new messages