How to use XPSViewer in Win32 based applications

hi:
Ihave a few qeutions to ask :
a)Our company's software(win32 based application) would spport xps file format, viewing and wirting the xps file. Could the XPSViewer be embeded in own software to view the xps file?
if can do, how to do? If can't, how to support to view the xps format file?
b)What are difference between win32 based application and WPF application? Could I use the new API classes under win32 based application? such asDocumentViewer, XpsDocument and so on.
[660 byte] By [beam] at [2008-2-25]
# 1

Question: Our company's software(win32 based application) would spport xps file format, viewing and wirting the xps file. Could the XPSViewer be embeded in own software to view the xps file?

Answer: No, this is not a supported scenario for the XPSViewer. (The XPSViewer is a WPF Application, btw.)

Question: What are difference between win32 based application and WPF application? Could I use the new API classes under win32 based application? such as DocumentViewer, XpsDocument and so on.

Answer: I believe it is possible to host a WPF component inside of a win32 application. (Or vice versa.) (Unfortunately, I cannot remember how to do this off the top of my head.) This does mean that you could create a control that would use DocumentViewer to view an XPSDocument inside of your application.

I can provide some code samples for how to extract a FixedDocumentSequence from an XPSDocument, if you need that. I just need to know what version of WPF you are running. Once you have a FixedDocumentSequence you can set the DocumentViewer.Document property to that value -- and voila! you are good to go.

HeatherGrantham at 2007-9-9 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2

You asked about how to use XPS from Win32 applications. The APIs Heather mentioned are just one more part of the Windows Presentation Foundation, and are managed code APIs which can be used together with an existing Win32s/hwnd-based application by way of interop functionality such as HwndHost and HwndSource. See my blog (http://blogs.msdn.com/nickkramer) or search the SDK for HwndHost and HwndSource for more details about interop.

NickKramer at 2007-9-9 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
We will be shipping an out of band native code based viewer. This viewer will implement Windows' iPreview interfaces. You can use these interfaces to view XPS documents inside your win32 applications. This will work for Windows XP, Server 03 and Vista.
MahmoodDhalla at 2007-9-9 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified