473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Previewing Documents In A Managed Application

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

Jul 20 '07 #1
3 3142
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.

--
Jim Barry, MVP (Windows SDK)
Jul 20 '07 #2
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]
- mv*@spam.guard.caspershouse.com

"Tim Haughton" <ti*********@gmail.comwrote in message
news:Wk*****************@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

Jul 20 '07 #3
Thanks Nicholas, I'm heading that way, so I'll give it a look.

Tim
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@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]
- mv*@spam.guard.caspershouse.com

"Tim Haughton" <ti*********@gmail.comwrote in message
news:Wk*****************@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

Jul 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marc te Vruchte | last post by:
Over the past years i've been in contact with the same problem a number of times, creating a graphical user interface on complex XML documents. Personally these solutions have never been...
5
by: R Kalal | last post by:
Hi- I am working on a very simple document management system. I would like to allow the user to control a scanner from inside the application(specifically, scan a document and save it in .pdf...
5
by: Q | last post by:
Hello you all, I want to store all kind of files (pdf, doc, xls, txt) in a database. This is no problem. The real problem is opening the files from within a .Net application. I tried several...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
1
by: Maury | last post by:
Hello, I would like to create a class/component which have to show the previews of the first page of some documents (.xls, .doc, .pdf) Is it possible in a simple way? If not, do you know some...
1
by: Laurent Navarro | last post by:
Hi, I created a C# application which opens a Word document, fills some fields and sends the whole document to the printer. Everything is working great but I find the printing step very slow....
3
by: Tim Haughton | last post by:
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...
3
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
1
by: lstuyck73 | last post by:
Hi all, I have a question concerning previewing a file in an ASP.NET application. I would like to have a feature that a file on the server (like powerpoint, word, pdf or excel file) could be...
2
by: vipinkmathews | last post by:
I wrote code for previewing a word dcoument in C#. In the code when the user click preview button the document gets opened and later the user manually closes the document. But in Task manager the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.