Loading ...
Sorry, an error occurred while loading the content.

[delphi-webbrowser] Re: TWebBrowse Bombs from server but not files???

Expand Messages
  • Christopher D. Coppola
    Make sure you have implemented the memory leak fix. There is a substantial memory leak in TWebbrowser that is corrected by changing the implementation of
    Message 1 of 9 , Mar 23, 1999
    View Source
    • 0 Attachment
      Make sure you have implemented the memory leak fix. There is a substantial
      memory leak in TWebbrowser that is corrected by changing the implementation
      of TOleControl.

      Basically, create a descendant of TOleControl (TrsOleControl) in my case
      that re-implements GetIDispatchProp & GetIUnknownProp. Make sure that
      TWebbrowser then inherits from TrsOleControl instead. The memory leak is
      significantly reduced. I've still detected some leakage, but substantially
      smaller.

      Here's the changed implementations:

      unit rsOleCtrls;

      interface
      uses
      OleCtrls;

      type
      TrsOleControl = class (TOleControl)
      protected
      function GetIDispatchProp(Index: Integer): IDispatch;
      function GetIUnknownProp(Index: Integer): IUnknown;
      end;

      implementation


      { TOleControlFix }

      function TrsOleControl.GetIDispatchProp(Index: Integer): IDispatch;
      var
      Temp: TVarData;
      begin
      GetProperty(Index, Temp);
      // Result := IDispatch(Temp.VDispatch); ***** Change to:
      Pointer(Result) := Temp.VDispatch; //this avoids the extra AddRef
      end;

      function TrsOleControl.GetIUnknownProp(Index: Integer): IUnknown;
      var
      Temp: TVarData;
      begin
      GetProperty(Index, Temp);
      // Result := IDispatch(Temp.VUnknown); ***** Change to:
      Pointer(Result) := Temp.VUnknown; //this avoids the extra AddRef
      end;

      end.


      > -----Original Message-----
      > From: gms@... [mailto:gms@...]
      > Sent: Tuesday, March 23, 1999 10:47 AM
      > To: delphi-webbrowser@egroups.com
      > Subject: [delphi-webbrowser] Re: TWebBrowse Bombs from server but not
      > files???
      >
      >
      > Hi Henri
      > Sorry for the confusion. I downloaded the web pages from the
      > Internet using a Delphi program I created that uses an HTTP component.
      > Automatically skip through 300 pages by passing a different url into
      > WebBrowser1.Navigate(sUrl, Flags, TargetFrameName, PostData, Headers);
      > Then in WebBrowser1.WebBrowser1DocumentComplete it enables a
      > timer which waits half a second then goes to the next record.
      > With this code the url can be on my hard drive from the web pages
      > I downloaded or from the server where they are being created dynamically.
      > The only reason I downloaded them to my hard drive was because
      > viewing them from the server was bombing after x tries.
      >
      > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=8
      > > I've read your message a couple of times and I'm still not sure
      > what you're doing.
      > >
      > > What do you mean by "I downloaded all the html and related
      > files"? Do you mean from the Internet using HTTP? Like a web-crawler?
      > >
      > > What do you mean by "automatically skip through say 300
      > records"? Are you storing the files that you download in a DB?
      > What do you mean by skip?
      > >
      > > If you are trying to download a bunch of HTML pages to review
      > offline or in some DB, then you shouldn't be using WebBrowser.
      > Rendering each of the HTML pages is too slow. Just use an HTTP
      > component and get the pages you want, then use WebBrowser to view
      > them later. If you don't want to use the HTTP component that
      > comes with Delphi, try the free ones at
      > http://www.rtfm.be/fpiette/indexuk.htm. I've already written a
      > simple web-crawler using this component. It works fine.
      > >
      > > Henri
      > >
      > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=7
      > > > Hi
      > > > If I downloaded all the html and related files to my machine
      > and automatically skip through say 300 records it does this perfectly.
      > > > With the exact same code when viewing records from the server it will
      > > > view anywhere between 1 and 30 before it bombs.
      > > > If I skip throught the same 3 records over and over from the
      > server it did not bomb.
      > > >
      > > > My knowledge of CPU error codes is limited.
      > > > The same CPU error comes up every time when it bombs.
      > > > The error from the cpu is 71012B7B movsx edx,[eax+ebx]
      > > > The below values will change.
      > > > EAX = FFFFFFAE, EBX = 001AE008, CF = 1, [$001ADFB6]=???
      > > > Movsx means it copies a signed value into a larger type.
      > > >
      > > > If run without the IDE Dr Watson comes up then the program quits.
      > > > I am running D4 C/S sp3, NT4 sp4 on Pentium Pro 200 with 128Meg Ram
      > > > In saying that I recall when automatically downloading the
      > html pages (in order to get the html on my hard drive) some pages
      > would time out so I had to increase the timeout time to have the
      > pages download seamlessly.
      > > > Could the same thing be happening here?
      > > > If so how can it be set?
      > > > --
      > > > Cheers
      > > > Glenn Shukster of Gms Computing Inc.
      > > > Thornhill, Ont. Canada
      > > > Phone:(905)771-6458 Fax:(905)771-6819 http://members.home.net/gms
      > > > http://members.home.net/gms
      > > >
      > >
      >
      > ------------------------------------------------------------------------
      > Track your stocks and funds in a StockMaster portfolio. With easy
      > setup, you get quotes, charts, and news for them all on just one page.
      > No limits, fast loading, and FREE! http://www.stockmaster.com/?a=f8
      >
      > eGroup home: http://www.eGroups.com/list/delphi-webbrowser
      > Free Web-based e-mail groups by eGroups.com
      >


      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/list/delphi-webbrowser
      Free Web-based e-mail groups by eGroups.com
    • gms@home.com
      Hi Christopher Yes I made that change already, Thanks. -- Cheers Glenn Shukster of Gms Computing Inc. Thornhill, Ont. Canada Phone:(905)771-6458
      Message 2 of 9 , Mar 23, 1999
      View Source
      • 0 Attachment
        Hi Christopher
        Yes I made that change already, Thanks.
        --
        Cheers
        Glenn Shukster of Gms Computing Inc.
        Thornhill, Ont. Canada
        Phone:(905)771-6458 Fax:(905)771-6819 http://members.home.net/gms


        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/list/delphi-webbrowser
        Free Web-based e-mail groups by eGroups.com
      • gms@home.com
        Hi Henri Yes I set it to 5 sec to no avail. It seems that if I run it outside of the IDE it runs a bit longer, but its still random when it will crash. Is
        Message 3 of 9 , Mar 23, 1999
        View Source
        • 0 Attachment
          Hi Henri
          Yes I set it to 5 sec to no avail. It seems that if I run it outside of the IDE it runs a bit longer, but its still random when it will crash. Is there a way to clear the cashe every time?

          The reason I am doing it that fast is that I need to print each one. My understanding is that I have to show it first. The other reason it is so fast is that it speeds up testing.

          Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=10
          > One thing that's different when you use local files vs. Internet is caching. IE doesn't cach local files (they're already local), so that might be part of your problem. Maybe caching that many pages at that speed is using up too many resources. Have you tried setting the Timer to more than half a second?
          >
          > BTW, why are you shoving all these pages through the WebBrowser component at this speed? Have you figured out how to read like Data on StarTrek? <g>
          >
          > Henri
          >
          > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=9
          > > Hi Henri
          > > Sorry for the confusion. I downloaded the web pages from the Internet using a Delphi program I created that uses an HTTP component.
          > > Automatically skip through 300 pages by passing a different url into
          > > WebBrowser1.Navigate(sUrl, Flags, TargetFrameName, PostData, Headers);
          > > Then in WebBrowser1.WebBrowser1DocumentComplete it enables a timer which waits half a second then goes to the next record.
          > > With this code the url can be on my hard drive from the web pages I downloaded or from the server where they are being created dynamically.
          > > The only reason I downloaded them to my hard drive was because viewing them from the server was bombing after x tries.
          > >
          > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=8
          > > > I've read your message a couple of times and I'm still not sure what you're doing.
          > > >
          > > > What do you mean by "I downloaded all the html and related files"? Do you mean from the Internet using HTTP? Like a web-crawler?
          > > >
          > > > What do you mean by "automatically skip through say 300 records"? Are you storing the files that you download in a DB? What do you mean by skip?
          > > >
          > > > If you are trying to download a bunch of HTML pages to review offline or in some DB, then you shouldn't be using WebBrowser. Rendering each of the HTML pages is too slow. Just use an HTTP component and get the pages you want, then use WebBrowser to view them later. If you don't want to use the HTTP component that comes with Delphi, try the free ones at http://www.rtfm.be/fpiette/indexuk.htm. I've already written a simple web-crawler using this component. It works fine.
          > > >
          > > > Henri
          > > >
          > > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=7
          > > > > Hi
          > > > > If I downloaded all the html and related files to my machine and automatically skip through say 300 records it does this perfectly.
          > > > > With the exact same code when viewing records from the server it will
          > > > > view anywhere between 1 and 30 before it bombs.
          > > > > If I skip throught the same 3 records over and over from the server it did not bomb.
          > > > >
          > > > > My knowledge of CPU error codes is limited.
          > > > > The same CPU error comes up every time when it bombs.
          > > > > The error from the cpu is 71012B7B movsx edx,[eax+ebx]
          > > > > The below values will change.
          > > > > EAX = FFFFFFAE, EBX = 001AE008, CF = 1, [$001ADFB6]=???
          > > > > Movsx means it copies a signed value into a larger type.
          > > > >
          > > > > If run without the IDE Dr Watson comes up then the program quits.
          > > > > I am running D4 C/S sp3, NT4 sp4 on Pentium Pro 200 with 128Meg Ram
          > > > > In saying that I recall when automatically downloading the html pages (in order to get the html on my hard drive) some pages would time out so I had to increase the timeout time to have the pages download seamlessly.
          > > > > Could the same thing be happening here?
          > > > > If so how can it be set?
          > > > > --
          > > > > Cheers
          > > > > Glenn Shukster of Gms Computing Inc.
          > > > > Thornhill, Ont. Canada
          > > > > Phone:(905)771-6458 Fax:(905)771-6819 http://members.home.net/gms
          > > > > http://members.home.net/gms
          > > > >
          > > >
          > >
          >

          ------------------------------------------------------------------------
          eGroup home: http://www.eGroups.com/list/delphi-webbrowser
          Free Web-based e-mail groups by eGroups.com
        • Adam Stiles
          There s a much easier way to do that. You can run the following command: rundll32.exe C: WINDOWS SYSTEM MSHTML.DLL,PrintHTML %1 and replace %1 with a URL.
          Message 4 of 9 , Mar 23, 1999
          View Source
          • 0 Attachment
            There's a much easier way to do that.

            You can run the following command:

            rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML "%1"

            and replace %1 with a URL.

            This will print the passed URL and you won't even see it.

            Adam Stiles
            Stilesoft Incorporated

            ----- Original Message -----
            From: <gms@...>
            To: <delphi-webbrowser@egroups.com>
            Sent: Tuesday, March 23, 1999 12:49 PM
            Subject: [delphi-webbrowser] Re: TWebBrowse Bombs from server but not
            files???


            > Hi Henri
            > Yes I set it to 5 sec to no avail. It seems that if I run it outside of
            the IDE it runs a bit longer, but its still random when it will crash. Is
            there a way to clear the cashe every time?
            >
            > The reason I am doing it that fast is that I need to print each one. My
            understanding is that I have to show it first. The other reason it is so
            fast is that it speeds up testing.
            >
            > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=10
            > > One thing that's different when you use local files vs. Internet is
            caching. IE doesn't cach local files (they're already local), so that might
            be part of your problem. Maybe caching that many pages at that speed is
            using up too many resources. Have you tried setting the Timer to more than
            half a second?
            > >
            > > BTW, why are you shoving all these pages through the WebBrowser
            component at this speed? Have you figured out how to read like Data on
            StarTrek? <g>
            > >
            > > Henri
            > >
            > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=9
            > > > Hi Henri
            > > > Sorry for the confusion. I downloaded the web pages from the Internet
            using a Delphi program I created that uses an HTTP component.
            > > > Automatically skip through 300 pages by passing a different url into
            > > > WebBrowser1.Navigate(sUrl, Flags, TargetFrameName, PostData, Headers);
            > > > Then in WebBrowser1.WebBrowser1DocumentComplete it enables a timer
            which waits half a second then goes to the next record.
            > > > With this code the url can be on my hard drive from the web pages I
            downloaded or from the server where they are being created dynamically.
            > > > The only reason I downloaded them to my hard drive was because viewing
            them from the server was bombing after x tries.
            > > >
            > > > Original Article:
            http://www.egroups.com/list/delphi-webbrowser/?start=8
            > > > > I've read your message a couple of times and I'm still not sure what
            you're doing.
            > > > >
            > > > > What do you mean by "I downloaded all the html and related files"?
            Do you mean from the Internet using HTTP? Like a web-crawler?
            > > > >
            > > > > What do you mean by "automatically skip through say 300 records"?
            Are you storing the files that you download in a DB? What do you mean by
            skip?
            > > > >
            > > > > If you are trying to download a bunch of HTML pages to review
            offline or in some DB, then you shouldn't be using WebBrowser. Rendering
            each of the HTML pages is too slow. Just use an HTTP component and get the
            pages you want, then use WebBrowser to view them later. If you don't want to
            use the HTTP component that comes with Delphi, try the free ones at
            http://www.rtfm.be/fpiette/indexuk.htm. I've already written a simple
            web-crawler using this component. It works fine.
            > > > >
            > > > > Henri
            > > > >
            > > > > Original Article:
            http://www.egroups.com/list/delphi-webbrowser/?start=7
            > > > > > Hi
            > > > > > If I downloaded all the html and related files to my machine and
            automatically skip through say 300 records it does this perfectly.
            > > > > > With the exact same code when viewing records from the server it
            will
            > > > > > view anywhere between 1 and 30 before it bombs.
            > > > > > If I skip throught the same 3 records over and over from the
            server it did not bomb.
            > > > > >
            > > > > > My knowledge of CPU error codes is limited.
            > > > > > The same CPU error comes up every time when it bombs.
            > > > > > The error from the cpu is 71012B7B movsx edx,[eax+ebx]
            > > > > > The below values will change.
            > > > > > EAX = FFFFFFAE, EBX = 001AE008, CF = 1, [$001ADFB6]=???
            > > > > > Movsx means it copies a signed value into a larger type.
            > > > > >
            > > > > > If run without the IDE Dr Watson comes up then the program quits.
            > > > > > I am running D4 C/S sp3, NT4 sp4 on Pentium Pro 200 with 128Meg
            Ram
            > > > > > In saying that I recall when automatically downloading the html
            pages (in order to get the html on my hard drive) some pages would time out
            so I had to increase the timeout time to have the pages download seamlessly.
            > > > > > Could the same thing be happening here?
            > > > > > If so how can it be set?
            > > > > > --
            > > > > > Cheers
            > > > > > Glenn Shukster of Gms Computing Inc.
            > > > > > Thornhill, Ont. Canada
            > > > > > Phone:(905)771-6458 Fax:(905)771-6819
            http://members.home.net/gms
            > > > > > http://members.home.net/gms
            > > > > >
            > > > >
            > > >
            > >
            >
            > ------------------------------------------------------------------------
            > Too much effort to find the stock info you want each day? StockMaster
            > lets you enter a company name and quickly shows you a daily quote,
            > chart, and news all on one page. Free! http://stockmaster.com/?a=f7
            >
            > eGroup home: http://www.eGroups.com/list/delphi-webbrowser
            > Free Web-based e-mail groups by eGroups.com
            >
            >


            ------------------------------------------------------------------------
            eGroup home: http://www.eGroups.com/list/delphi-webbrowser
            Free Web-based e-mail groups by eGroups.com
          • gms@home.com
            Hi Adam Thanks. That is an excellent suggestion. I tried it and can print but I keep getting the Print settings box to come up each time. In another user
            Message 5 of 9 , Mar 23, 1999
            View Source
            • 0 Attachment
              Hi Adam
              Thanks. That is an excellent suggestion.
              I tried it and can print but I keep getting the Print settings box to come up each time.
              In another user group someone suggested the below line would get rid of the Print settings box, however, the printer I am testing with doesn't have an IPAddress.
              rundll32 mshtml.dll,PrintHTML, "file.htm" "PrinterName" "WINSPOOL"
              "IPAddressOfPrinter"
              Any thoughts?

              If I am printing say 1000 at one session how will that work?
              Will it all buffer to disk or will I get an error message at some point?

              If this works then all thats left is the other problem of viewing x number of web pages without bombing.

              <007001be756f$be2b9720$0100005-@...> wrote:
              Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=14
              > There's a much easier way to do that.
              >
              > You can run the following command:
              >
              > rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML "%1"
              >
              > and replace %1 with a URL.
              >
              > This will print the passed URL and you won't even see it.
              >
              > Adam Stiles
              > Stilesoft Incorporated
              >
              > ----- Original Message -----
              > From: <gms@...>
              > To: <delphi-webbrowser@egroups.com>
              > Sent: Tuesday, March 23, 1999 12:49 PM
              > Subject: [delphi-webbrowser] Re: TWebBrowse Bombs from server but not
              > files???
              >
              >
              > > Hi Henri
              > > Yes I set it to 5 sec to no avail. It seems that if I run it outside of
              > the IDE it runs a bit longer, but its still random when it will crash. Is
              > there a way to clear the cashe every time?
              > >
              > > The reason I am doing it that fast is that I need to print each one. My
              > understanding is that I have to show it first. The other reason it is so
              > fast is that it speeds up testing.
              > >
              > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=10
              > > > One thing that's different when you use local files vs. Internet is
              > caching. IE doesn't cach local files (they're already local), so that might
              > be part of your problem. Maybe caching that many pages at that speed is
              > using up too many resources. Have you tried setting the Timer to more than
              > half a second?
              > > >
              > > > BTW, why are you shoving all these pages through the WebBrowser
              > component at this speed? Have you figured out how to read like Data on
              > StarTrek? <g>
              > > >
              > > > Henri
              > > >
              > > > Original Article: http://www.egroups.com/list/delphi-webbrowser/?start=9
              > > > > Hi Henri
              > > > > Sorry for the confusion. I downloaded the web pages from the Internet
              > using a Delphi program I created that uses an HTTP component.
              > > > > Automatically skip through 300 pages by passing a different url into
              > > > > WebBrowser1.Navigate(sUrl, Flags, TargetFrameName, PostData, Headers);
              > > > > Then in WebBrowser1.WebBrowser1DocumentComplete it enables a timer
              > which waits half a second then goes to the next record.
              > > > > With this code the url can be on my hard drive from the web pages I
              > downloaded or from the server where they are being created dynamically.
              > > > > The only reason I downloaded them to my hard drive was because viewing
              > them from the server was bombing after x tries.
              > > > >
              > > > > Original Article:
              > http://www.egroups.com/list/delphi-webbrowser/?start=8
              > > > > > I've read your message a couple of times and I'm still not sure what
              > you're doing.
              > > > > >
              > > > > > What do you mean by "I downloaded all the html and related files"?
              > Do you mean from the Internet using HTTP? Like a web-crawler?
              > > > > >
              > > > > > What do you mean by "automatically skip through say 300 records"?
              > Are you storing the files that you download in a DB? What do you mean by
              > skip?
              > > > > >
              > > > > > If you are trying to download a bunch of HTML pages to review
              > offline or in some DB, then you shouldn't be using WebBrowser. Rendering
              > each of the HTML pages is too slow. Just use an HTTP component and get the
              > pages you want, then use WebBrowser to view them later. If you don't want to
              > use the HTTP component that comes with Delphi, try the free ones at
              > http://www.rtfm.be/fpiette/indexuk.htm. I've already written a simple
              > web-crawler using this component. It works fine.
              > > > > >
              > > > > > Henri
              > > > > >
              > > > > > Original Article:
              > http://www.egroups.com/list/delphi-webbrowser/?start=7
              > > > > > > Hi
              > > > > > > If I downloaded all the html and related files to my machine and
              > automatically skip through say 300 records it does this perfectly.
              > > > > > > With the exact same code when viewing records from the server it
              > will
              > > > > > > view anywhere between 1 and 30 before it bombs.
              > > > > > > If I skip throught the same 3 records over and over from the
              > server it did not bomb.
              > > > > > >
              > > > > > > My knowledge of CPU error codes is limited.
              > > > > > > The same CPU error comes up every time when it bombs.
              > > > > > > The error from the cpu is 71012B7B movsx edx,[eax+ebx]
              > > > > > > The below values will change.
              > > > > > > EAX = FFFFFFAE, EBX = 001AE008, CF = 1, [$001ADFB6]=???
              > > > > > > Movsx means it copies a signed value into a larger type.
              > > > > > >
              > > > > > > If run without the IDE Dr Watson comes up then the program quits.
              > > > > > > I am running D4 C/S sp3, NT4 sp4 on Pentium Pro 200 with 128Meg
              > Ram
              > > > > > > In saying that I recall when automatically downloading the html
              > pages (in order to get the html on my hard drive) some pages would time out
              > so I had to increase the timeout time to have the pages download seamlessly.
              > > > > > > Could the same thing be happening here?
              > > > > > > If so how can it be set?
              > > > > > > --
              > > > > > > Cheers
              > > > > > > Glenn Shukster of Gms Computing Inc.
              > > > > > > Thornhill, Ont. Canada
              > > > > > > Phone:(905)771-6458 Fax:(905)771-6819
              > http://members.home.net/gms
              > > > > > > http://members.home.net/gms
              > > > > > >
              > > > > >
              > > > >
              > > >
              > >
              > > ------------------------------------------------------------------------
              > > Too much effort to find the stock info you want each day? StockMaster
              > > lets you enter a company name and quickly shows you a daily quote,
              > > chart, and news all on one page. Free! http://stockmaster.com/?a=f7
              > >
              > > eGroup home: http://www.eGroups.com/list/delphi-webbrowser
              > > Free Web-based e-mail groups by eGroups.com
              > >
              > >
              >
              >

              ------------------------------------------------------------------------
              eGroup home: http://www.eGroups.com/list/delphi-webbrowser
              Free Web-based e-mail groups by eGroups.com
            Your message has been successfully submitted and would be delivered to recipients shortly.