The data area passed to a system call is too small

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alhulimy

    The data area passed to a system call is too small



    i am traing to print usisng printer (samsung srp-350) for invoice
    printing
    but nothing so far...


    -----------------------
    Private Sub Button1_Click_4 (ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click


    printFont = New Font("Arial", 10)
    Dim pd As New PrintDocument
    'pd.PrinterSett ings.PrinterNam e = "HP Deskjet D1400
    series"
    pd.PrinterSetti ngs.PrinterName = "SAMSUNG SRP350"



    AddHandler pd.PrintPage, AddressOf pd_PrintPage

    pd.Print()



    End Sub
    Private Sub pd_PrintPage(By Val sender As Object, ByVal ev As
    PrintPageEventA rgs)


    ev.Graphics.Dra wString("a", printFont, Brushes.Black, 2, 4)

    End Sub

    --------------------------
    it works witht othre pritners but this samsung srp-350 is not working

    as a result from the code above i got this exception:


    --------------------------
    An unhandled exception of type 'System.Compone ntModel.Win32Ex ception'
    occurred in system.drawing. dll
    Additional information: The data area passed to a system call is too
    small
    ----------------------------------------------
    any idea how to sovlve this ?
  • Cor Ligthert[MVP]

    #2
    Re: The data area passed to a system call is too small

    Hi,

    I don't see this one in your code.
    (copied from MSDN)

    \\\
    If pd.PrinterSetti ngs.IsValid then
    pd.Print()
    Else
    MessageBox.Show ("Printer is invalid.")
    End If
    ///

    Cor

    "alhulimy" <alhulimy@gmail .comschreef in bericht
    news:43950039-db28-4317-a079-37f67e40bc48@m4 5g2000hsb.googl egroups.com...
    >
    >
    i am traing to print usisng printer (samsung srp-350) for invoice
    printing
    but nothing so far...
    >
    >
    -----------------------
    Private Sub Button1_Click_4 (ByVal sender As System.Object, ByVal e As
    System.EventArg s) Handles Button1.Click
    >
    >
    printFont = New Font("Arial", 10)
    Dim pd As New PrintDocument
    'pd.PrinterSett ings.PrinterNam e = "HP Deskjet D1400
    series"
    pd.PrinterSetti ngs.PrinterName = "SAMSUNG SRP350"
    >
    >
    >
    AddHandler pd.PrintPage, AddressOf pd_PrintPage
    >
    pd.Print()
    >
    >
    >
    End Sub
    Private Sub pd_PrintPage(By Val sender As Object, ByVal ev As
    PrintPageEventA rgs)
    >
    >
    ev.Graphics.Dra wString("a", printFont, Brushes.Black, 2, 4)
    >
    End Sub
    >
    --------------------------
    it works witht othre pritners but this samsung srp-350 is not working
    >
    as a result from the code above i got this exception:
    >
    >
    --------------------------
    An unhandled exception of type 'System.Compone ntModel.Win32Ex ception'
    occurred in system.drawing. dll
    Additional information: The data area passed to a system call is too
    small
    ----------------------------------------------
    any idea how to sovlve this ?

    Comment

    • alhulimy

      #3
      Re: The data area passed to a system call is too small

      On 11 ãÇíæ, 08:58, "Cor Ligthert[MVP]" <notmyfirstn... @planet.nl>
      wrote:
      Hi,
      >
      I don't see this one in your code.
      (copied from MSDN)
      >
      \\\
       If pd.PrinterSetti ngs.IsValid then
                     pd.Print()
                  Else
                     MessageBox.Show ("Printer is invalid.")
                  End If
      ///
      >
      Cor
      >
      "alhulimy" <alhul...@gmail .comschreef in berichtnews:439 50039-db28-4317-a079-37f67e40bc48@m4 5g2000hsb.googl egroups.com...
      >
      >
      >
      >
      >
      i am traing to print usisng printer (samsung srp-350) for invoice
      printing
      but nothing so far...
      >
      -----------------------
      Private Sub Button1_Click_4 (ByVal sender As System.Object, ByVal e As
      System.EventArg s) Handles Button1.Click
      >
                 printFont = New Font("Arial", 10)
                 Dim pd As New PrintDocument
                 'pd.PrinterSett ings.PrinterNam e = "HP Deskjet D1400
      series"
                 pd.PrinterSetti ngs.PrinterName = "SAMSUNG SRP350"
      >
                 AddHandler pd.PrintPage, AddressOf pd_PrintPage
      >
                 pd.Print()
      >
         End Sub
         Private Sub pd_PrintPage(By Val sender As Object, ByVal ev As
      PrintPageEventA rgs)
      >
             ev.Graphics.Dra wString("a", printFont, Brushes.Black, 2, 4)
      >
       End Sub
      >
      --------------------------
      it works witht othre pritners but this samsung srp-350 is not working
      >
      as a result from the code above i got this exception:
      >
      --------------------------
      An unhandled exception of type 'System.Compone ntModel.Win32Ex ception'
      occurred in system.drawing. dll
      Additional information: The data area passed to a system call is too
      small
      ----------------------------------------------
      any idea how to sovlve this ?- ÅÎÝÇÁ ÇáäÕ ÇáãÞÊÈÓ -
      >
      - ÚÑÖ ÇáäÕ ÇáãÞÊÈÓ -
      I add to my code but stilll I face the same problem
      any idea ?

      Comment

      Working...