精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
I've successfully implemented Print Preview in the MFC application by implementing IPrintPreviewCallback interface in the document class and quering server object for IInplacePrintPreview interface. I can post (or send) the solution somewhere if someone is interested. 我已经通过文档类的IPrintPreviewCallback接口和服务器对象的IInplacePrintPreview接口成功的实现了在MFC应用程序中打印预览。如果有人感兴趣我可以发布(或发送)解决方案。
I used Microsoft FramerEx sample (http://support.microsoft.com/kb/q268470/[^]) and description of the above interfaces (http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaro97ta/html/msdn_binder97.asp[^]) for reference. 上述接口中我用到了Microsoft FramerEx例子(http://support.microsoft.com/kb/q268470/[^])和说明(http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaro97ta/html/msdn_binder97.asp[^]) 以供参考。
Also I took main part of the MFC code implementing IInplacePrintPreview from http://www.codeguru.com/forum/archive/index.php/t-75806.html[^]. 另外我从http://www.codeguru.com/forum/archive/index.php/t-75806.html[^] 中找到了实施IInplacePrintPreview的主要MFC代码。
The main problem that I currently have is crash after print preview is closed when using Office XP/2003, although it's working perfectly with Office 97/2000. Microsoft FramerEx example has the same problem. 我目前的主要问题是它在Office97/2000中正常使用,但是在使用Office XP / 2003时,打印预览结束后就会死机。Microsoft FramerEx 例子中也有同样的问题。
I think it may be due to the fact that these interfaces have been developed for use with Microsoft Binder which is not included in OfficeXP/2003 and it's support is now limited (http://support.microsoft.com/?scid=kb;en-us;822622&spid=2525&sid=276[^]). 我认为这可能是这样的:这些接口已经以Microsoft Binder的形式开发使用并不包含OfficeXP / 2003并且它支持的是有限的(http://support.microsoft.com/?scid=kb;EN-US;822622&SPID=2525&SID =276[^])。
I have noticed that if another instance of MS Word is opened while print preview is active in my program, and I close print preview, my program does not crash, but that another MS word window is repositioned right above the main frame where my print preview was displayed. So I think maybe the server application "dies" when I close print preview (or IInplacePrintPreview::ExitPrintPreview is executed).
我注意到,如果打开MS Word中的另一个实例,同时打印预览也打开使用,当我关闭打印预览时,我的程序就不会崩溃,但在我的打印预览上面另一个MS Word窗口的右主框架重新定位被显示出来。所以我想,当我关闭打印预览(或执行打印预览::退出打印预览)时,也许服务器应用程序会“死机”。
I'm now trying to find a workaround to this problem, maybe by launching hidden insance of MS Word or creating another "temporary document". I'm not sure if it will help, so have anyone experienced the same problem?
我现在试图找到这个问题的解决方案,也许通过启动MS Word中的隐藏insance或创建另一个“临时文件”来解决,我不确定这有没有用,,所以有人经历过同样的问题吗?
Is this someting you woe to share?这就是你分享的东西吗?
The part of implementing the printpreview in MFC? 实施MFC打印预览的一部分?
Magnus
OK, basically I used the code found on this page to implement the Print Preview.http://www.codeguru.com/forum/archive/index.php/t-75806.html.I can post the sample project somewhere if you suggest where I can post it.I have no time for a long description now, but I can answer your questions if you have some.
好,我使用的实现打印预览的代码基本上是从这个页面找到的:http://www.codeguru.com/forum/archive/index.php/t-75806.html.如果你给我一个我可以粘贴样本项目的地方,我可以张贴过去。 我现在没有时间描述很长一段,但是如果你有一些问题,我可以回答你。
The biggest problem that I faced after implementing the print preview is an inevitable crash in the application after the print preview window is closed if using Office XP/2003.While investigating the problem, I have installed MS Binder application from MS Office 2000 (along with full Office 2003 installed). I did so because the interfaces to support Print Preview were initially designed for MS Binder, that has been removed from the latest versions of MS Office. I found the same problem with the Print Preview opened inside MS Binder.
我面临的最大的问题就是:如果使用Office XP / 2003实行打印预览,,关闭打印预览窗口后,应用程序会死机。在调查这个问题时,我已经安装了MS Office 2000的应用程序(连同完整的安装Office 2003)。我这样做,因为最初MS Binder支持打印预览的接口,已经从MS Office的最新版本中删除。我发现在MS Binder中打印预览有同样的问题。
Finally I found that the print preview works correctly if I uncheck the "Windows on Taskbar" option in MS Word settings (that was introduced starting from Office 2000). It seems to be a bug from MS, so I found no better solution than disabling this option programmatically by modifying registry value "Settings" under the following key:HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Data
最后我发现,如果我取消在MS Word中设置的“Windows任务栏上的”选项(即引入从Office2000开始),打印预览就能正常工作。似乎是MS中的错误,所以我发现没有比通过修改注册表值“设置”编程禁用此选项更好的解决办法了:HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Data
Crulex:
I used the interface IInplacePrintPreview to show word print preview in my frame. I can make it preview, but the size of the preview window is not the same as the size of the main frame . I want to know your sollution.
我使用了接口IInplacePrintPreview显示我的框架打印预览。我可以让它预览,但预览窗口的大小是不一样。我想知道你的解决方案。
Thank you very much!
非常感谢!