如何在手动启动的打印机扩展中获取IPrintSchemaTicket [英] How to obtain IPrintSchemaTicket in manually launched Printer Extension

查看:67
本文介绍了如何在手动启动的打印机扩展中获取IPrintSchemaTicket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我通过执行"printext.exe"手动运行打印机扩展应用程序。当应用程序启动时,我订阅IPrinterExtensionEvent并调用EnableEvents,然后接收OnPrinterQueuesEnumerated。在该处理程序中,我从IPrinterExtensionContextCollection获取IPrinterExtensionContext。
然后尝试通过  IPrintSchemaTicket更改默认打印机首选项,但是当我调用IPrinterExtensionContext :: get_PrintSchemaTicket时,我总是收到错误:  0x8000000e:在意外时间调用了一个方法。

I run printer extension app manually, by executing "printext.exe". When app starts I subscribe to IPrinterExtensionEvent and call EnableEvents, then receive OnPrinterQueuesEnumerated. In that handler I get IPrinterExtensionContext from IPrinterExtensionContextCollection. Then try to change default printer preferences via IPrintSchemaTicket, but when I call IPrinterExtensionContext::get_PrintSchemaTicket I always get an error:  0x8000000e : A method was called at an unexpected time.

任何人都可以解释一下为什么会发生这种情况吗?或者,如果不是从打印机首选项启动,如何从打印机扩展程序更改默认打印机设置?  

Could anyone explain me why this happens? Or how can I change default printer settings from printer extension when it launched not from printer preferences?  







推荐答案

您好E61B,

Hi E61B,

更改默认打印首选项在队列枚举期间不支持,因此您收到的错误是预期的。

Changing the default print preferences during queue enumeration is not supported, so the error you received is expected.

我们支持从设备和打印机更改默认PrintTicket。只需右键单击设备,选择打印首选项,然后您的应用程序将以打印首选项模式启动,用户所做的任何选择将作为默认打印
设置提交。

We support changing the default PrintTicket from Devices and Printers. Simply right click on the device, choose Printing Preferences, then your app will be launched in the print preferences mode and any choices users make will be committed as default print settings.

谢谢!

Justin


这篇关于如何在手动启动的打印机扩展中获取IPrintSchemaTicket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆