0

i am trying to print a raw data to the printer. i got my codes from http://support.microsoft.com/kb/322090

in the code segment...

   Dim di As New DOCINFOW


    With di

        .pDocName = "My Visual Basic .NET RAW Document"        
        .pDataType = "TEXT"
        .pOutputFile = vbNull
    End With

 If OpenPrinter(szPrinterName.Normalize(), hPrinter, IntPtr.Zero) Then
        If StartDocPrinter(hPrinter, 1, di) Then
            If StartPagePrinter(hPrinter) Then
                bSuccess = WritePrinter(hPrinter, pBytes, dwCount, dwWritten)
                EndPagePrinter(hPrinter)
            End If
            EndDocPrinter(hPrinter)
        End If
        ClosePrinter(hPrinter)
    End If

the first if returns TRUE but the If StartDocPrinter(hPrinter, 1, di) Then returns FALSE that's why further nested if cannot be catered. I have worked in this problem for hours searching, etc to no avail. Anybody who happened to encounter the same problem may have a solution. Thank you.

waine
  • 111
  • 1
  • 1
  • 5

0 Answers0