开发者

How to avoid overloading of application main form by multi tabs webbrowser?

I'm using multiple TCppWebBrowsers on main form, and when I start the application all tabs from last internet session are recovered. But this makes the main form of application to overload much. My question is how can I avoid overloading of main form?

I tried myself to achieve it but had no success. I used TThread class from C++ Builder and tried to start navigation from there, but unsuccessful, main form still overloading. I also tried CreateThread() - same thing.

I have found:

WebBrowser Control (MFC) created in seperate thread working in Windows 7 and Vista开发者_JAVA百科, but Windows XP

But I do not understand this very well.

Please somebody tell me how to solve my question in C++ Builder!


If possible, I'd leave the threads aside and would try loading one page after another. It's easier. All you have to do is to not load the content of all TCppWebBrowsersat once, instead start by loading only the first (visible to the user) then load the others one by one.

Load a tab when one of the following happens:

  • the user activates a tab - you should definitely load this page immediately
  • the application is idle and no other tab is loading - load the next one

Do this until all tabs are loaded.

Of course you need to be able to somehow influence the "session recovering mechanism" to implement this delay-loading. But if you would be able to add threads then you should also be able to just load the tabs one by one. This will spread the load over a longer time and should prevent overloading your app at startup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜