EPSON OPOS/MS POS and .NET 4.0 CONVERSION

Locked EPSON OPOS/MS POS and .NET 4.0 CONVERSION

  • Friday, May 18, 2012 9:42 PM
     
     

    Hi!

    I am trying to take the examples from the Epson SDK which was written in .NET 2.0 and convert them to use with 4.0.  Here is the code I have from the examples.. I am getting an error though when trying to use it.  Any ideas?Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    Private m_Printer As Microsoft.PointOfService.PosPrinter

            '<<<step1>>>--Start
            'Use a Logical Device Name which has been set on the SetupPOS.
            Dim strLogicalName As String
            Dim deviceInfo As DeviceInfo
            Dim posExplorer As PosExplorer

            strLogicalName = "PosPrinter"

            'Create PosExplorer
            posExplorer = New PosExplorer

            m_Printer = Nothing

            Try

                deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName)

                Label1.Text = deviceInfo.ToString
                m_Printer = posExplorer.CreateInstance(deviceInfo)

            Catch ex As Exception
                'ChangeButtonStatus()
                Return
            End Try

            Try

                'Open the device
                m_Printer.Open()

                'Get the exclusive control right for the opened device.
                'Then the device is disable from other application.
                m_Printer.Claim(1000)

                'Enable the device.
                m_Printer.DeviceEnabled = True

            Catch ex As PosControlException

                'ChangeButtonStatus()

            End Try
            '<<<step1>>>--End

        End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

            '<<<step1>>> Start
            Try
                'As using the PrintNormal method, send strings to a printer, and print it
                '[vbCrLf] is the standard code for starting a new line.
                m_Printer.PrintNormal(PrinterStation.Receipt, "Hello OPOS for .Net")  <--- the error is in this line

            Catch ex As PosControlException

            End Try
            '<<<step2>>> End

        End Sub

All Replies

  • Saturday, May 19, 2012 4:48 AM
    Answerer
     
     Answered

    If you are trying to use POS for .NET, .NET 2.0 is still needed.

    -Sean


    www.sjjmicro.com / www.seanliming.com / www.annabooks.com, Book Author - Pro Guide to WES 7, XP Embedded Advanced, Pro Guide to POS for .NET

    • Marked As Answer by PREGIS Friday, June 01, 2012 4:40 PM
    •