Hi All,
I'm a newbie to the POS system. so please mind if my questions are stupid.
I have an epson TM-U200 printer with USB connection and cash drawer connected to printer with RJ 11 cable.
I tried to create a service object for my printer and suceeds.(It shows on test app as a POS Printer)
this is my code for that. -
[HardwareId(@"USB\Vid_0525&Pid_a700",@"USB\Vid_0525&Pid_a700")]
-
[ServiceObject(DeviceType.PosPrinter,"PrinterTemplate","Printer Class",1,9)]
-
public class MyPrinter : PosPrinterBase
-
{ private string MyHealthText;
-
-
public MyPrinter()
-
{
-
// Initialize device capability properties.
-
MyHealthText = "";
-
}
-
-
~MyPrinter()
-
{
-
Dispose(false);
-
}
-
-
// Release any resources managed by this object.
-
protected override void Dispose(bool disposing)
-
{
-
try
-
{
-
// Your code here.
-
}
-
finally
-
{
-
// Must call base class Dispose.
-
base.Dispose(disposing);
-
}
-
}
-
#region PosCommon overrides
-
// Returns the result of the last call to CheckHealth().
-
public override string CheckHealthText
-
{
-
get
-
{
-
// MsrBasic.VerifyState(mustBeClaimed,
-
// mustBeEnabled). This may throw an exception.
-
VerifyState(false, false);
-
-
return MyHealthText;
-
}
-
}
-
-
public override string CheckHealth(
-
HealthCheckLevel level)
-
{
-
// Verify that device is open, claimed, and enabled.
-
VerifyState(true, true);
-
-
// Your code here:
-
// check the health of the device and return a
-
// descriptive string.
-
-
// Cache result in the CheckHealthText property.
-
MyHealthText = "Ok";
-
return MyHealthText;
-
}
-
-
public override DirectIOData DirectIO(
-
int command,
-
int data,
-
object obj)
-
{
-
// Verify that device is open.
-
VerifyState(false, false);
-
-
return new DirectIOData(data, obj);
-
}
-
#endregion // PosCommon overrides
-
protected override PrintResults PrintNormalImpl(PrinterStation station, PrinterState printerState, string data)
-
{
-
throw new Exception("The method or operation is not implemented.");
-
}
-
protected override void ValidateDataImpl(PrinterStation station, string data)
-
{
-
throw new Exception("The method or operation is not implemented.");
-
}
-
-
}
-
I register this with posdm in the name "Printer"
This is my application. -
PosExplorer ex = new PosExplorer();
-
DeviceInfo d = ex.GetDevice(DeviceType.PosPrinter, "Printer");
-
PosPrinter printer = (PosPrinter)ex.CreateInstance(d);
-
printer.Open();
-
printer.Claim(1000);
-
printer.DeviceEnabled = true;
-
//printer.PrintNormal(PrinterStation.Receipt, "SSSSSS");
-
-
printer.Release();
-
printer.Close();
-
this PrintNormal method giving me an error saying "The receipt station is not present". I cannot figure it out. Please help me on this.
and if I want to open the cash drawer, can I use the printnormal method for that. something like "printer.PrintN ormal(PrinterSt ation.Receipt, "ESC /27,112,0,25,250 ");"
I'm really confused.
3 6787
I fixed your code tags. They end with [/code]
Hi I overcome the problem with setting
Properties.CapR ecPresent = true;
But now it give me another error. -
System.Exception: The method or operation is not implemented.
-
at IndexPrinter.IndexPrinter.PrintNormalImpl(PrinterStation station, PrinterState printerState, String data)
-
at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.OutputRequestHandler(OutputRequest Request)
-
at Microsoft.PointOfService.Internal.PosCommonInternal.ProcessOutputRequest(OutputRequest request, Boolean asyncOperation)
-
at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.ProcessRequest(PrintOperation operation)
-
at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.PrintNormal(PrinterStation station, String data)
-
at IndexPrinter.IndexPrinter.PrintNormal(PrinterStation station, String data)
-
at TestApplication.PosPrinterScreen.PrintButton_Click(Object sender, EventArgs e)
-
-
I include this code in the class
public override void PrintNormal(Pri nterStation station, string data)
{
base.PrintNorma l(station, data);
}
But it give me the same error. please help
Geeshan, did you ever solve this problem??, because I run into the same errors...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Patrick Herb |
last post by:
Hello,
I'm trying to print the content of a RichTextBox from my VB 6 app.
What I want is that the CommonDialog shows up, the user selects a
printer and the content of the RichTextBox prints to the selected
printer. I'm not concerned about the text format.
What I tried is something like this
CommonDialog1.ShowPrinter
|
by: Bruce Adams |
last post by:
I am using VB6 SP6. I have an application that prints charts. Specifically,
it prints line charts of plant process information nightly. The code is a
mix of API calls and Printer methods. I am currently migrating to a new PC
running XP. The charting application is hanging on a single line of code:
Printer.Orientation = vbPRORLandscape
It throws an error '484', "Problem getting information from the printer.
Make sure printer is set up...
|
by: KohlerTommy |
last post by:
In my application I need to give the user the ability to print duplex if the
selected printer supports duplex printing. Many of the printer options do
not make much sense in my application, and many of the settings in the common
printer dialog would have a negative impact on my printing process. To
handle this strict printing constraint on which my application imposes I do
not want to show the common print dialog. I want to be able to...
|
by: James Griffiths |
last post by:
Here is a report I've written about a printing problem that is being
experienced by a particular company for whom I had developed a A97 system.
After upgrading to Win XP and AXP, some printing problems have arisen. My
investigations show that it is not related to the particular system I
developed. but is affecting Access in general. So, has nothing to do with
reports being set to print to a default printer (which they all are) or to a...
|
by: David Trivette |
last post by:
I was wondering if anyone could help me with a MS Access 2002 issue
I'm having.
Problem - I created a db in Access 97 which worked just fine for
several years. In the db the user can generate reports straight to a
printer after a query has run. The user of this db just got a new
computer with Windows XP and Access 2002.
Now when the user runs the report the following error message is
displayed:
| |
by: Hank |
last post by:
My Access 2000 code has been running for several years in our main
plant. Now we need to install it, as a stand-along application, at
remote sites, some of which are out of state.
My problem is the printer destination for special reports such as
stickers and mailing labels. The Mailing Label report is, of course,
designed here for a specific printer (Mailing Label). At another site,
the name could be completely different. Other than...
|
by: akhosravi4703 |
last post by:
I'm having a problem with an application I pushed out recently.
First, some background
The application was made with Access 97 (unfortunately I'm stuck with
this older version for the moment)
The app is compiled into an MDE on a network drive from which several
users access it in one location
I'm an entry-level programmer, so please frame your answers for less
experienced =)
|
by: Mark |
last post by:
Hello,
I have a VB6 Project that uses an ini file to save selected printer settings
for several forms. The program allows users to select the printer on their
work station for printing forms. If a printer is not selected for a
particular form, the user is prompted to select a printer. The program saves
the printer selections to an ini file.
THE PROBLEM:
This program works well most of the time. On occasion, a specific printer...
|
by: groulder |
last post by:
hi all,
i have a problem with a network database that's used by a lot of
people.
people are finding, they will start the database, and if the mouse is
moved over the print icon, the tooltip appears to show which printer it
will print to as normal. this printer however is a printer that the
user doesn't even have installed.
|
by: id10t error |
last post by:
Hello,
I am going to be using a Symbol WT4090 to scan items. I need to
printer a tag from the Zebra ql320 plus. I am trying to do this is
Visual basic 2005. Does anyone know and good site to find out how to
do this. I have looked everywhere i know with no luck. Thank you in
advance for your help.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |