Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BHO and MIME Filter - how to communicate

13 views
Skip to first unread message

Rory

unread,
Jun 27, 2009, 12:39:58 PM6/27/09
to
I have a BHO that does a bunch of things, and have now realised that I
also want to access the HTML before all the embedded images etc have
downloaded, ie before DocumentComplete is called. It seems the way to
do this is to implement a MIME filter. So firstly, does anyone have a
sample of using a combination of BHO and MIME filter? (preferably
using c#)

I want to communicate from my MIME filter to my BHO, informing it when
some HTML has been downloaded so it can do various things. I don't
actually need to manipulate the HTML itself, but I do need to parse it
and sometimes record various elements. (Also I'll have to deal with
the case when the client of the html request isn't an IWebBrowser2 so
there's no BHO). With a BHO there's a single instance of the BHO per
IE window/tab. I'll wire up the temporary MIME filter from within the
BHO. Should I create a separate one per BHO or just the first BHO
loaded within the process? Assuming it's just once per process, when
my MIME filter gets called how can I then determine which which
IWebBrowser2 has requested the HTML?

As for communicating between the BHO and MIME Filter, I guess I can
simply use static variables to get a reference from one to another (as
suggested here:
http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_thread/thread/977c5c08c82d89c/e9349716cda5abf7?q=bho+mime+filter+group:microsoft.public.inetsdk.programming.*#e9349716cda5abf7),
but am not clear how to identify from the MIME filter which BHO to
communicate with.

Any suggestions appreciated, thanks

- Rory

Igor Tandetnik

unread,
Jul 10, 2009, 2:18:34 PM7/10/09
to
Rory <rory....@gmail.com> wrote:
> I have a BHO that does a bunch of things, and have now realised that I
> also want to access the HTML before all the embedded images etc have
> downloaded, ie before DocumentComplete is called. It seems the way to
> do this is to implement a MIME filter. So firstly, does anyone have a
> sample of using a combination of BHO and MIME filter? (preferably
> using c#)

I have reasons to believe that a MIME filter cannot be implemented in
C#. Certainly an Asynchronous Pluggable Protocol (a related technology)
implemented in .NET was tried and failed:

http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_frm/thread/57d6e3492094c051

> I want to communicate from my MIME filter to my BHO

http://groups.google.com/group/microsoft.public.inetsdk.programming.webbrowser_ctl/browse_frm/thread/3a255f3cf3f827df

> With a BHO there's a single instance of the BHO per
> IE window/tab. I'll wire up the temporary MIME filter from within the
> BHO. Should I create a separate one per BHO or just the first BHO
> loaded within the process?

MIME filter is registered per-process. It's pointless to install it more
than once for the same MIME type.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


0 new messages