Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / July 2007

Tip: Looking for answers? Try searching our database.

Previewing Documents In A Managed Application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Haughton - 20 Jul 2007 10:34 GMT
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
Jim Barry - 20 Jul 2007 14:21 GMT
> 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.

Signature

Jim Barry, MVP (Windows SDK)

Tim Haughton - 23 Jul 2007 09:00 GMT
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

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.
Nicholas Paldino [.NET/C# MVP] - 20 Jul 2007 17:04 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.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?
[quoted text clipped - 10 lines]
>
> Tim
Tim Haughton - 23 Jul 2007 09:02 GMT
Thanks Nicholas, I'm heading that way, so I'll give it a look.

Tim

> Tim,
>
[quoted text clipped - 16 lines]
>>
>> Tim

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.