Dan Morris

I'm drowning in this bug that I just can't figure out... I have a BHO that I've been using happily on several machines for a while. I've tested primarily under XP Pro w/IE7. All is well. In fact it seems to work under Vista and IE6 as well.

But on _some_ machines that appear to be configured just like other machines I've tested on (XP Pro, IE7), I can register and enable the BHO just fine (I know my constructor gets called and runs to completion), but SetSite is never called. Here's the real kicker... GetSite _is_ called, so it's not a problem with hooking up the IObjectWithSite interface.

Can anyone think of _anything_ that could cause this behavior Any help would be _hugely_ appreciated.

Thanks...

-Dan



Re: Internet Explorer Extension Development SetSite not called... sometimes... help!

Dan Morris

For those who are interested... the problem was some sort of runtime linking issue; SetSite called a function that was apparently not available. I would have expected a link error to either cause the whole assembly to fail when IE tried to load it (which was not the case, since my constructor and getsite ran just fine) _or_ to cause an error when I called the offending function (in which case SetSite would still be called and would partially execute), and it didn't even occur to me that an illegal reference could just cause SetSite to not get called. I guess IE does all the linking at _call_ time, instead of at load time

In any case, I still don't really understand how I fixed it (always disappointing); I basically recompiled the DLL that this line was accessing and enabled and disabled the BHO a few times.

The moral of the story is that when working with BHO's, a function might never be called because a call inside the function makes the run-time linker unhappy.

Hope that helps someone out there...

-Dan




Re: Internet Explorer Extension Development SetSite not called... sometimes... help!

John Sudds - MSFT

Is this managed C++ or C#, perchance

BTW, it is a lesser known fact that IE relies on GetSite to determine who "owns" the control or BHO. If the control doesn't return the original site when requested, IE will not call SetSite(NULL) upon uninitialization.

(Yea, I know it's only remotely related to the thread at hand, but an interesting tidbit nevertheless.)






Re: Internet Explorer Extension Development SetSite not called... sometimes... help!

Henri Hein

Yes, that is an interesting tidbit. I've scratched my head before wondering why I didn't get the SetSite(NULL) call. Now I know! Thanks John...