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

Loading IWebBrowser2 with data from structured storage streams without creating intermediate files.

56 views
Skip to first unread message

vpaive...@gmail.com

unread,
May 9, 2009, 5:21:03 PM5/9/09
to
Hi,

My application is a desktop application written in VC++.

Previously I had files in the format e.g. PDF, Text, HTML, JPG etc
lying on the disk. I used Web browser as a viewer for these files.
Since the files were lying on the disk IWebBrowser2-> Navigate2 method
worked great for my specific scenario.

Now I want to move these scattered files into a single structured
storage document. I want to load these documents into the web browser
without creating intermediate files [one approach was to copy the
stream as a file on disk and use navigate2 method but this is not a
clean approach].

I tried following:

1. Microsoft documented approach for loading HTML content from
streams. [http://msdn.microsoft.com/en-us/library/aa752047(VS.
85).aspx]

This works great for html and text files. JPG files work great in IE
6.0 and 7.0 but not in IE 8.0 version. PDF files load as weird text in
IE 7.0 and 8.0.

2. IPersistMoniker implementation:

This has the exact same behavior as point 1.

The question is how do I load files from stream and yet get the same
behavior as Navigate2 method without creating intermediate files :)?

Let me know if there is another approach to all this.

Best Regards,
Vishal

Igor Tandetnik

unread,
May 9, 2009, 7:35:08 PM5/9/09
to
<vpaive...@gmail.com> wrote in message
news:357ee69d-3c42-4c79...@g31g2000pra.googlegroups.com

> Previously I had files in the format e.g. PDF, Text, HTML, JPG etc
> lying on the disk. I used Web browser as a viewer for these files.
> Since the files were lying on the disk IWebBrowser2-> Navigate2 method
> worked great for my specific scenario.
>
> Now I want to move these scattered files into a single structured
> storage document. I want to load these documents into the web browser
> without creating intermediate files [one approach was to copy the
> stream as a file on disk and use navigate2 method but this is not a
> clean approach].

You may want to implement an Asynchoronous Pluggable Protocol (APP):

http://msdn.microsoft.com/en-us/library/aa767743.aspx

Note however that Acrobat Reader (the most common viewer for PDF files)
requires a physical file on disk. I don't know of any way around it.
--
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


Vishal Pai

unread,
May 10, 2009, 3:01:06 AM5/10/09
to
On May 9, 4:35 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
> <vpaiverne...@gmail.com> wrote in message

Yes looks like that is the only approach available. But it looks like
too much work in terms of coding, deployment and testing :(. I was
just hoping that there might be something simple :(.

I was wondering why would IE have this limitation? For e.g. loading of
jpg works great in IE 7.0 but in IE 8.0 it is broken (or may be its a
feature).

What documentation should I read to understand how IE loads different
document types? Is there any other control available that can help me
achieve this?

Best Regards,
Vishal

0 new messages