Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8093407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:29:50+00:00 2026-06-05T20:29:50+00:00

I wrote a Delphi function retrieving a web page from another application. This works

  • 0

I wrote a Delphi function retrieving a web page from another application.

This works fine when I use a file to store the information via

Result := URLDownloadToFile( nil, PChar( XmlUrl), PChar( XmlFileName_), 0, nil);

When I use an URLOpenBlocking-stream I get the correct information but the second time I do a request to the webserver I get the old page although the page has changed.

Does anybody have an idea what could be the cause ?

function MyDownloadToBlockingSteam( URL : String; Var bsXmlStr : AnsiString): LongInt;
var
  ppStream  : ActiveX.IStream;
  statstg   : TStatStg;
  dwRead    : Integer;
begin
  Result := 1;

  bsXmlStr := '';

  If (URLOpenBlockingStream(nil, PChar(URL), ppStream, 0, nil) = S_OK) then
  Begin
    // Resource protection
    try
      if (ppStream.Stat(statstg, STATFLAG_NONAME) = S_OK) then // Get the stat from the IStream interface
      begin
        if (statstg.cbSize > 0) then // Make sure size is greater than zero
        begin
          SetLength ( bsXMLStr, statstg.cbSize+1 );
          Result := ppStream.Read( @bsXMLStr[1], statstg.cbSize, @dwRead); // Read from the stream
        end;
      end;
    finally
      ppStream:=nil; // Release the IStream interface
    end;
  end;//If ..
end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:29:51+00:00Added an answer on June 5, 2026 at 8:29 pm

    Consider using InternetOpenUrl() and InternetReadFile() instead. It will take a few extra lines of coding to manually accomplish the same thing that URLOpenBlockingStream() does internally for you, but InternetOpenUrl() does have a dwFlags parameter which accepts an INTERNET_FLAG_RELOAD flag to force downloading the latest data from the URL. URLOpenBlockingStream() does not have that option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While browsing System.Zip (Delphi XE2) to see how it works, I found this function:
I have a process that currently runs in a Delphi application that I wrote
David's answer to another question shows a Delphi DLL function returning a WideString. I
I wrote this code in Delphi XE which assign the GUID of the interface
I wrote an application (a psychological testing exam) in Delphi (7) which creates a
i'm having problems calling a delphi function from C# (attempted to read or write
I use Indy 9 with Delphi 5. In my application I want to communicate
I'm trying to convert an old Delphi program I wrote into Java to compile
I'm trying to write a Delphi console application that creates a TStream for its
I need to read from and write to Excel spreadsheets using Delphi 2010. Nothing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.