Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. An Error Message Come When Printing with OPOS Printer

An Error Message Come When Printing with OPOS Printer

Scheduled Pinned Locked Moved Visual Basic
helpsysadminquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pdnet
    wrote on last edited by
    #1

    Hello All, I am going to Print some File from my application. But I am facing some Problems. some times an error message is comming : --------------------------- SOTHER~1 --------------------------- Object is not connected to server --------------------------- OK --------------------------- but there is no problem in Printing, its working fine, but the message box is coming again when going to print next file. My Code is below : ---------------------- For i = 0 To files.Count - 1 Try POSEx = New PosExplorer PrintFileName = files.Item(i) fileData = My.Computer.FileSystem.GetFileInfo(PrintFileName) fileContents = My.Computer.FileSystem.ReadAllText(PrintFileName) If InStr(fileData.Name, ".") > 0 Then PrinterName = (fileData.Name).Split(".")(0) If PrinterName <> DupPrinterName Then SetDeviceVariable(PrinterName) End If DupPrinterName = PrinterName End If device = POSEx.GetDevice(DeviceType.PosPrinter, PrinterName) If Not device Is Nothing Then Printer = POSEx.CreateInstance(device) Printer.Open() Printer.Claim(1000) Printer.DeviceEnabled = True Printer.PrintNormal(2, fileContents) If bCutPaper = True Then Printer.CutPaper(0) End If Printer.DeviceEnabled = False Printer.Release() Printer.Close() System.IO.File.Delete(PrintFileName) End If Catch ex As PosControlException End Try Next Note: My Printing Function written in a separate Thread and it always searches is there any files in my application folder or not. So, How can I fixed this Prolem.

    Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

    D 1 Reply Last reply
    0
    • P pdnet

      Hello All, I am going to Print some File from my application. But I am facing some Problems. some times an error message is comming : --------------------------- SOTHER~1 --------------------------- Object is not connected to server --------------------------- OK --------------------------- but there is no problem in Printing, its working fine, but the message box is coming again when going to print next file. My Code is below : ---------------------- For i = 0 To files.Count - 1 Try POSEx = New PosExplorer PrintFileName = files.Item(i) fileData = My.Computer.FileSystem.GetFileInfo(PrintFileName) fileContents = My.Computer.FileSystem.ReadAllText(PrintFileName) If InStr(fileData.Name, ".") > 0 Then PrinterName = (fileData.Name).Split(".")(0) If PrinterName <> DupPrinterName Then SetDeviceVariable(PrinterName) End If DupPrinterName = PrinterName End If device = POSEx.GetDevice(DeviceType.PosPrinter, PrinterName) If Not device Is Nothing Then Printer = POSEx.CreateInstance(device) Printer.Open() Printer.Claim(1000) Printer.DeviceEnabled = True Printer.PrintNormal(2, fileContents) If bCutPaper = True Then Printer.CutPaper(0) End If Printer.DeviceEnabled = False Printer.Release() Printer.Close() System.IO.File.Delete(PrintFileName) End If Catch ex As PosControlException End Try Next Note: My Printing Function written in a separate Thread and it always searches is there any files in my application folder or not. So, How can I fixed this Prolem.

      Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Which line does the error occur on?? Since you're using a third party library (I've never heard of it), you're best source of information would be the manufacturer of that library.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Which line does the error occur on?? Since you're using a third party library (I've never heard of it), you're best source of information would be the manufacturer of that library.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        P Offline
        P Offline
        pdnet
        wrote on last edited by
        #3

        Printer.Release() Printer.Close() Any of this line I am getting That error.

        Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

        D 1 Reply Last reply
        0
        • P pdnet

          Printer.Release() Printer.Close() Any of this line I am getting That error.

          Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Guy, the best source of information you have on this is going to be the people who wrote that printer library you're using. I have no idea what it is, nor how it works, so there's very little I can tell you.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups