Deza

It looks impossible, but: Is there a way to have a persistent instance of a BHO across all the Tabs That is, the same BHO instance for all the Tabs.

At least, does somebody knows a ˇ°strategyˇ± for to simulate this behavior



Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

proxygrid

you shared the one bho, only want to use the shared data among your instances.

you can use shared data among all your instances, like #pragma data_seg(".SHARED") etc.






Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

FleetCommand

I'd be thanful if you could explain more about shared data.




Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Reza Nourai - MSFT

The "strategy" would depend on what you are trying to accomplish by having only one instance (or simulating one instance).

If your goal is to share data across the instances, I generally declare static variables in the class so that all instances (tabs) use the same data.

Let us know what exactly you want to do and we can try to come up with a good way to implement it.

-Reza





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Deza

My BHO takes one or many segments of HTML from each page that must to be the same for all the Tabs. Then, when I take a segment from a Tab, how can I reflex this new segment in all the Tabs without losing performance The synchronization of all the BHO is too heavy; more when there are many segments and tabs. Even more complex if I try to keep the same appearance between instances.

 

The ideal solution is to have a single BHO instance for all the Tabs; like the favorites or firefox.





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Sheng Jiang

You can put your shared code in an automation server and register it in the Running Object Table




Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Deza

Question about BHO instances, Shared Data, Shared Code, Automation and the ROT:

Is it possible that a BHO instance "acts" as replica of another

e.g.: If in a BHO I add a button, this also appears  in the other one.

If anybody has a code sample with Ms-Excel, Ms-Calc, or whatever.

Preferably: .Net & C#

Thanks





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Deza

IE7 creates and destroys a BHO for each Tab created or destroyed, so

I have a very concrete question and directed to the developers of IE:

Are there plans to develop an IE version where the BHOs are created and destroyed with the IE browser

Your answer is too important for my project.

Thank you very much

Deza





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

EricLaw-MSFT

We're still looking at requirements for a future version of IE, and improving the extension model is of course part of that.

It's very helpful for us to learn what types of tasks you'd like to accomplish using your extensions so we can ensure any improvements are useful to you.

You should not expect this change to appear in current versions of IE, however, so you should probably consider the approaches described above for now.





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

IECUSTOMIZER

Hi Deza,

Have a look at either the Google or Live toolbars, which both have options to add buttons dynamically to the toolbar. I am not sure about the Google toolbar but with the live toolbar if you place a debug statement on the browser OnPropertychange event you will see some chatter in exchanging properties between instances of the toolbar.

I imagine you just need to create a property that flags a change to the toolbars button layout, so that each toolbar can refresh its layout properties (perhaps by re-reading registry settings)

Pseudo code.

User adds button to toolbar.

Write new button to toolbar settings in the registry.

Flag a change to the toolbar layout by using the setProperty event.

Other loaded toolbars filter the OnPropertyChange event for the toolbar change and reload the toolbar layout settings from the registry and redraw each instance of the toolbar.

Regards.






Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

RatneshK

From the above discussion i get that one can share BHO data simply by making it "static" but that's only across multiple tabs of the browser, but can we share BHO data across all browser window instances (not tabs), i mean different IE processes.

for more clarification regarding this question plz visit http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1587538&SiteID=1




Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Reza Nourai - MSFT

You would achieve this the same as you would in any other mutli-process application.

Depending on your specific needs, you could use any of the following techniques: memory-mapped files, globally allocated handles, flat file access, cross-process communication via pipes/messages, COM events (connection points), RPC, etc... the list goes on.

You can look up any of the methods and see what their pros/cons are, and select the one that meets your app specific goals.

-Reza





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

R.Hartmann

What about using a singleton You have just to protect critical members against concurrent access.




Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

Reza Nourai - MSFT

Unfortunately, that won't work, as nice as it would be. I can't recall exactly why not, but I will dig that info up for you shortly.

-Reza





Re: Internet Explorer Extension Development Just one BHO's instance for all the Tabs.

R.Hartmann

I hope you didn't misunderstand me. I did't not suggest to run the BHO as a singleton but to use a singleton across the BHO instances. This works for windows and tabs running in the same IE process.