Pos.net in VB.Net 2005 application

A

Alaa

I have created a POS system for franchise retailer shops and my final task is
to allow the shop operator to print a receipt and open the cash drawer and
display the total on a line display device if available.
Application written in VB.Net 2005 with access database as a back-end.
I have watched the tutorial movie clip on MSN and went through a lot of
posts and microsoft site but really could not get valuable information to
VB.Net
So, here are few questions I would appreciate if anyone can post a reply
which might help me to understand how to use Pos.net

Please note that I do not have any POS devices yet, still waiting for the
samples to arrive

1- Do I need to install POS.net on every single computer uses my POS
application, or can I distribute the required pos.net dll files only

2-How to discover the attached POS devices using VB.Net, I am using the
following code:
Imports Microsoft.PointOfService
------ some other codes inside the form class -----
Dim myExp As PosExplorer
Dim myDvc As DeviceCollection
Dim mySgldvc As DeviceInfo

Private sub GetPOSDeviceDisplayName()
myExp = New PosExplorer
myDvc = myExp.GetDevices
cmbDevices.Items.Clear()
For Each mySgldvc In myDvc
If mySgldvc.LogicalNames.Length > 0 Then
cmbDevices.Items.Add(mySgldvc.LogicalNames)
Else
cmbDevices.Items.Add(mySgldvc.ServiceObjectName)
End If

Next
End Sub

When I run my sample application on my development server, it runs with no
errors as the Pos.net is installed, when I run the sample application on an
XP Pro without the POS.Net installed "only POS.net dll files registered" it
complains about not finding some pos.net registry keys?

3- Assuming that the code in point 2 is correct, if the user select the POS
printer from the list, is the following code correct to print a receipt using
the selected printer

myExp = New PosExplorer
myPosPrinter = nothing
mySgldvc = myExp.GetDevice(DeviceType.PosPrinter, cmbDevices.Text)
'assuming that cmbDevices.Text holds the logical pos printer name
myPosPrinter = myExp.CreateInstance(mySgldvc)


myPosPrinter.Open()
myPosPrinter.Claim(1000)
myPosPrinter.DeviceEnabled = True
myPosPrinter.RecLetterQuality = True

'one sample line of printing
myPosPrinter.PrintNormal(PrinterStation.Receipt, "Hello World" + vbCrlf)

'release device
myPosPrinter.Release()
myPosPrinter.Close()


Apology for the long post, but I would appreciate if someone could tell me
if the above codes would work for any kind of PosPrinter and if there is a
sample on how to open a cash drawer in VB.Net would be great.

I hope I selected the right discussion group :)

Much appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top