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

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?
 
R

Rob ^_^

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top