Hi,

I get the "The data area passed to a system call is too small" error on my 
HttpOpenRequest call.  The program works fine on my local machine but if I 
copy it to the server where it should run I get this error.

fuction doCall( const aUrl : String ) : String;
var
  hSession, hHostConnection, hDownload: HINTERNET;
  Buffer: PChar;
  dwBufLen, dwIndex, dwBytesRead, dwTotalBytes: DWORD;
  HasSize: Boolean;
  Buf: array [0..1024] of Byte;
  l_stream : TStream;
  l_strStream : TStringStream;
begin
  //open the connection to the internet
  hsession := InternetOpen(PChar(''), INTERNET_OPEN_TYPE_DIRECT, nil, nil, 
0);
  if hSession = nil then
  begin
    Result := SysErrorMessage(GetLastError);
    Exit;
  end;

  // Connect to the host
  hHostConnection := InternetConnect(hSession, PChar(aUrl), 0, nil, nil, 
INTERNET_SERVICE_HTTP, 0, DWORD(0));

  if hHostConnection = nil then
  begin
    Result := 'Error in connection';
    Exit;
  end;

  //Request the file
  hDownload := HttpOpenRequest(hHostConnection, 'GET', PChar(''), 
'HTTP/1.0',
    PChar(''), nil, INTERNET_FLAG_RELOAD or INTERNET_FLAG_PRAGMA_NOCACHE, 
0);

  if hDownload = nil then
  begin
    Result := 'Could not download ' + SysErrorMessage(GetLastError);
    Exit;
  end;

  //Send the request
  HttpSendRequest(hDownload, nil, 0, nil, 0);


Could anybody assist in sorting out this error?

Thanks VERY much
Francois



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.9/622 - Release Date: 2007/01/10
14:52 PM
 
__________________________________________________
Delphi-Talk mailing list -> Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to