ERROR: Fails to Open device when using ESC/OPOS fr

2019-09-04 09:24发布

问题:

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?

回答1:

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:

With OPOSPOSPrinter1 .Open "RECEIPT"



标签: vb6