错误:从 VB6 使用 ESC/OPOS 时无法打开设备 [英] ERROR: Fails to Open device when using ESC/OPOS from VB6

查看:28
本文介绍了错误:从 VB6 使用 ESC/OPOS 时无法打开设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一些 VB6 代码转换为直接打印到 EPSON TMU 220D Receipt 打印机使用 VB 6 的 ESC/OPOS ADK.我在我的项目中添加了对 OPOS ADK 的引用.甚至 ADK 附带的示例程序也不起作用.我已经设置了打印机并为其指定了一个逻辑设备名称.我什至卸载了收据打印机自己的驱动程序,然后重新安装了它们.当我调用 OPOS 控件的 open 方法时,我不断收到以下错误:无法打开设备".我很困惑,因为文档说 OPOS ADK 与设备无关.我做错了什么?

I'm trying to convert some VB6 code to print directly to the EPSON TMU 220D Receipt printer using the ESC/OPOS ADK for VB 6. I have added a reference to the OPOS ADK in my project. Even the sample programs that come with the ADK dont work. I have setup the printer and given it a logical device name. I even un-installed the receipt printer's own drivers and then re-installed them. I keep getting the following error: 'Failed to open device' when I call the OPOS control's open method. I'm puzzled because the documentation says that the OPOS ADK is device indepedent. What I'm I doing wrong?

推荐答案

明白了.我只需要确保 OPOS 控件的 open 方法的参数(字符串)与使用 OPOS 设备设置实用程序设置打印机时提供给打印机的逻辑设备名称(LDN)相同.也就是说,如果 LDN 是 'RECEIPT' &假设您将 OPOS 控件命名为OPOSPOSPrinter1",请按如下方式调用 OPOS 控件的 open 方法:

Got it. I just had to ensure that the argument(string) for the open method of the OPOS control was the same as the logical device name(LDN) given to the printer when setting it up using OPOS device setup utility. That is if the LDN is 'RECEIPT' & assuming you name the OPOS control 'OPOSPOSPrinter1', call the open method of the OPOS control as follows:

使用 OPOSPOSPrinter1.打开收据"

With OPOSPOSPrinter1 .Open "RECEIPT"

这篇关于错误:从 VB6 使用 ESC/OPOS 时无法打开设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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