Appendix B – Sample Programs
174
Class Series 2 Programmer’s Manual
MsgBox “You must Open a file to send”, vbExclamation
Exit Sub
End If
‘ Open file.
f1 = FreeFile
Open loadfile For Binary As f1
‘ Open printer for printing
res& = OpenPrinter(SelPrinter, hPrinter, 0)
If res = 0 Then
MsgBox “Unable to open the printer”
Exit Sub
End If
docinfo.pDocName = “MyDoc”
docinfo.pOutputFile = vbNullString
docinfo.pDatatype = vbNullString
jobid = StartDocPrinter(hPrinter, 1, docinfo)
Call StartPagePrinter(hPrinter)
Call WritePrinter(hPrinter, ByVal printdata$, Len(printdata$), written)
While Not EOF(1)
Get #f1, , ch
printdata$ = ch
Call WritePrinter(hPrinter, ByVal printdata$, Len(printdata$),
written)
Wend
Call EndPagePrinter(hPrinter)
Call EndDocPrinter(hPrinter)
Call ClosePrinter(hPrinter) ‘ Close when done
‘ Close file
Close #1
MsgBox “File sent to print spooler.”, vbExclamation
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub Form_Load()
Dim X As Printer
‘ search for printer queue name / driver name
For Each X In Printers
If X.Port = “LPT1:” Then ‘printer found
‘ Set printer as system default.
SelPrinter = X.DeviceName
Exit For
End If
Next
End Sub
Private Sub lpt2_Click()
Содержание A-Class
Страница 2: ......
Страница 4: ......
Страница 20: ...Overview 8 Class Series 2 Programmer s Manual ...
Страница 28: ...Immediate Command Functions 16 Class Series 2 Programmer s Manual ...
Страница 136: ...Extended System Level Command Functions 124 Class Series 2 Programmer s Manual ...
Страница 156: ...Label Formatting Command Functions 144 Class Series 2 Programmer s Manual ...
Страница 176: ...Generating Label Formats 164 Class Series 2 Programmer s Manual ...
Страница 188: ...Appendix B Sample Programs 176 Class Series 2 Programmer s Manual ...
Страница 196: ...Appendix D Reset Codes 184 Class Series 2 Programmer s Manual ...
Страница 208: ...Appendix E Single Byte Symbol Sets 196 Class Series 2 Programmer s Manual ...
Страница 260: ...Appendix G Bar Code Details 248 Class Series 2 Programmer s Manual ...
Страница 280: ...Appendix J General Purpose Input Output Port Applications 268 Class Series 2 Programmer s Manual ...
Страница 292: ...Appendix O UPC A and EAN 13 Variable Price Weight Bar Codes 280 Class Series 2 Programmer s Manual ...
Страница 304: ...Appendix Q Plug and Play IDs 292 Class Series 2 Programmer s Manual ...
Страница 308: ...Appendix R Line Mode 296 Class Series 2 Programmer s Manual ...
Страница 320: ...Appendix T WiFi Region Country Codes 308 Class Series 2 Programmer s Manual ...
Страница 324: ...Appendix U Display Icon Key and Control Panel Button Sequence Functions 312 Class Series 2 Programmer s Manual ...
Страница 330: ......