Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxix Buzz, wwwxxxdbgf, ncurses font size, WWWXXX USABLE, WwwXXX MPEG4, WWWXXX BABBAGE WWWXXX, IIS_asps05kj, WWWXXXDOCO, WWW.XXX,GCDMO, Idl Wwwxxx

Links

XODOX
Impressum

#1: Previewing Documents In A Managed Application

Posted on 2007-07-20 11:34:47 by Tim Haughton

Hi, I'm trying to implement a preview feature in a managed application to
preview files of arbitrary type. Has anyone done this in a managed app? I've
seen at least one suggestion that you can host prevhost on your form, but
I'm not sure this is correct.

I've seen the IPreviewHandler and IPreviewHandlerFrame interfaces, but
haven't managed to use them from C#. They both live in shobjidl.idl, but
when I create the type library using midl.exe, the key interfaces are
missing.

Can anyone offer any assistance?

Tim

Report this message

#2: Re: Previewing Documents In A Managed Application

Posted on 2007-07-20 15:21:42 by Jim Barry

Tim Haughton wrote:
> Hi, I'm trying to implement a preview feature in a managed
> application to preview files of arbitrary type. Has anyone done this
> in a managed app? I've seen at least one suggestion that you can host
> prevhost on your form, but I'm not sure this is correct.

I suppose you could, but I think it would be rather hard work. Also, =
preview handlers are new for Vista so it wouldn't be much use on =
previous versions. If you just want a pictorial representation of a =
file, you could show a thumbnail. On Vista, =
IShellItemImageFactory::GetImage makes this very easy. On older Windows =
versions, you can fall back to GetUIObjectOf/IExtractImage.

--=20
Jim Barry, MVP (Windows SDK)

Report this message

#3: Re: Previewing Documents In A Managed Application

Posted on 2007-07-20 18:04:49 by mvp

Tim,

Why not just declare the interfaces in C# code manually? They are not
that big, and the types are not so complex that it would be very difficult.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Tim Haughton" <timhaughton@gmail.com> wrote in message
news:Wk%ni.4682$EM4.1490@fe07.news.easynews.com...
> Hi, I'm trying to implement a preview feature in a managed application to
> preview files of arbitrary type. Has anyone done this in a managed app?
> I've
> seen at least one suggestion that you can host prevhost on your form, but
> I'm not sure this is correct.
>
> I've seen the IPreviewHandler and IPreviewHandlerFrame interfaces, but
> haven't managed to use them from C#. They both live in shobjidl.idl, but
> when I create the type library using midl.exe, the key interfaces are
> missing.
>
> Can anyone offer any assistance?
>
> Tim

Report this message

#4: Re: Previewing Documents In A Managed Application

Posted on 2007-07-23 10:00:35 by Tim Haughton

Thanks Jim, we already have the IShellItemImage factory stuff in their, but
it's kind of a document management application, so we need the preview stuff
as well - and it's a Vista only app.


Cheers,

Tim

"Jim Barry" <jim@mvps.org> wrote in message
news:OL2kpDtyHHA.3940@TK2MSFTNGP05.phx.gbl...
Tim Haughton wrote:
> Hi, I'm trying to implement a preview feature in a managed
> application to preview files of arbitrary type. Has anyone done this
> in a managed app? I've seen at least one suggestion that you can host
> prevhost on your form, but I'm not sure this is correct.

I suppose you could, but I think it would be rather hard work. Also, preview
handlers are new for Vista so it wouldn't be much use on previous versions.
If you just want a pictorial representation of a file, you could show a
thumbnail. On Vista, IShellItemImageFactory::GetImage makes this very easy.
On older Windows versions, you can fall back to GetUIObjectOf/IExtractImage.

Report this message

#5: Re: Previewing Documents In A Managed Application

Posted on 2007-07-23 10:02:21 by Tim Haughton

Thanks Nicholas, I'm heading that way, so I'll give it a look.

Tim


"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:%23RANxcuyHHA.1176@TK2MSFTNGP05.phx.gbl...
> Tim,
>
> Why not just declare the interfaces in C# code manually? They are not
> that big, and the types are not so complex that it would be very
> difficult.
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Tim Haughton" <timhaughton@gmail.com> wrote in message
> news:Wk%ni.4682$EM4.1490@fe07.news.easynews.com...
>> Hi, I'm trying to implement a preview feature in a managed application to
>> preview files of arbitrary type. Has anyone done this in a managed app?
>> I've
>> seen at least one suggestion that you can host prevhost on your form, but
>> I'm not sure this is correct.
>>
>> I've seen the IPreviewHandler and IPreviewHandlerFrame interfaces, but
>> haven't managed to use them from C#. They both live in shobjidl.idl, but
>> when I create the type library using midl.exe, the key interfaces are
>> missing.
>>
>> Can anyone offer any assistance?
>>
>> Tim
>
>

Report this message