I need to open Cash Drawer in my WPF application, this is the first time I deal with Cash Drawer, after some search I have knew that I'll use Microsoft Point of Services. So I have installed POSforDotNet V1.14 and start new project and added the reference, I have found this example :
CashDrawer myCashDrawer;
PosExplorer explorer;
public MainWindow()
{
InitializeComponent();
this.Loaded += MainWindow_Loaded;
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
explorer = new PosExplorer();
DeviceInfo ObjDevicesInfo = explorer.GetDevice("CashDrawer");
myCashDrawer = explorer.CreateInstance(ObjDevicesInfo);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
myCashDrawer.Open();
myCashDrawer.Claim(1000);
myCashDrawer.DeviceEnabled = true;
myCashDrawer.OpenDrawer();
myCashDrawer.DeviceEnabled = false;
myCashDrawer.Release();
myCashDrawer.Close();
}
You can download my test application HERE
I have tried but it dose not work :(
gave me error in myCashDrawer = explorer.CreateInstance(ObjDevicesInfo); line
Please can help me because I'm stuck with Microsoft Point of Services and I'm not fully understand it.