Why is my Explorer Bar's constructor called 2 times? - (on BHO)

  • Thread starter Thread starter keandi
  • Start date Start date
K

keandi

Why is my Explorer Bar's constructor called 2 times? - (on BHO)

Hi.

I'm making an Explorer Bar.
In default, it isn't called SetSite.
So I wrote BHO registry info in .rgs.
Finally the SetSite is called.

But the class (included SetSite) is called 2 times.
First time, it can make windows.
Second time, it can't make windows because already the windows were
made at the first time.

I wonder why it is called 2 times...

Ah.. I downloaded a program
(http://www.codeproject.com/shell/cookiespy.asp)
This program is also called 2 times.

Why is my Explorer Bar's constructor called 2 times?
 
Hi Keandi,

Look for BandObjects at the CodeProject for an example toolbar. Some
toolbars use a satelite BHO to read ITBarlayout to position the toolbar. You
are getting two calls because you have registry entries for a BHO and a
toolbar.

When you load the toolbar (2nd) time you can test the hwnd value of the
"new" setsite and decide whether to load (if its not loaded) the toolbar.

The examples on CodeProject should show you the way.

Regards.
 
Back
Top