products support drivers news events contact site map home
   
Thermal Printers  |  Dot Matrix Printers  |  Kiosk Printers  |  Mechanisms  |  Your Application
 
     
 
  Star Micronics America, Inc. Small Receipt & Forms Printer Support
 
   
Drivers  |  Manuals  |  Programming Samples  |  Technology  |  Marketing  |  Application Notes 
 
 
   
    Programming Samples

Programming Tools:

1. StarComm

Summary: StarComm is a Visual Basic component (.ocx file) which allows for
easy communication with Star printers over any interface type.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6

Download: ZIP File StarComm.zip

2. StarComm.NET

Summary: The StarComm.NET project is a .NET version of the StarComm project
above. The project consists of a class library (WLStarComm.dll) and control
library (StarComm.dll) and a document explaining it's usage.

Note: For information on programming samples for StarComm.NET, please click here.

Operating System: Windows (All Versions)
Programming Language: Visual Basic.NET, C#.NET, J#.NET, Managed C++

Download: ZIP File StarComm.NETv1.0.2022.zip


Programming Samples:

Find Topic:


1. Two Color Printing

Summary: This sample demonstrates printing in both red and black to
two color enabled printers.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: Miscellaneous

Download Project Files: ZIP File TwoColorSample.zip
Download Text Sample: TXT File TwoColorSample.txt
Back to top


2. Opening connected Cashdrawer

Summary: This sample demonstrates opening the connected cash drawer.
The Star command for opening the cash drawer is 07 (Hex) or 7 (Dec).

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: Miscellaneous

Download Project Files: ZIP File CashDrawerSample.zip
Download Text Sample: TXT File CashDrawerSample.txt
Back to top


3. Printer Status (Direct to Port)

Summary: This sample allows a user to receive printer status bytes
over a parallel or serial connection.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: Status

Download Project Files: ZIP File StatusSample_Port.zip
Download Text Sample: TXT File StatusSample_Port.txt
Back to top


4. Printer Status (Windows Driver)

Summary: This sample allows a user to receive printer status bytes
using the Language Monitor embedded in the Windows driver.

Note: This sample includes code for displaying printer Online/Offline status.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: Status

Download Project Files: ZIP File StatusSample_Driver.zip
Download Text Sample: TXT File StatusSample_Driver.txt
Back to top


5. OPOS

Summary: This sample demonstrates OPOS usage in a Visual Basic sample.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: OPOS

Download Project Files: ZIP File OPOSSample.zip
Download Text Sample: TXT File OPOSSample.txt
Back to top


6. Printing to the Windows Spooler (winspool.drv)

Summary: This sample demonstrates printing through Windows drivers using
the "winspool.drv" link library.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: Spooler

Download Project Files: ZIP File SpoolerSample.zip
Download Text Sample: TXT File SpoolerSample.txt
Back to top


7. TCP300 Card Reader/Writer

Summary: This sample demonstrates all TCP300 printing abilities, including
magnetic stripe reading and writing.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: TCP300/400

Download Project Files: ZIP File TCPCardWriter.zip
Back to top


8. TCP300 BMP Store

Summary: This sample demonstrates storing BMP images in the TCP300's ROM2
flash memory for continual usage.

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: TCP300/400

Download Project Files: ZIP File TCPBMPStore.zip
Back to top


9. TCP300 BMP Printing

Summary: This sample demonstrates printing all image types using a TCP300. (Images
are converted to BMP before sending to printer.)

Operating System: Windows (All Versions)
Programming Language: Visual Basic 6
Topic: TCP300/400

Download Project Files: ZIP File TCPBMPPrinting.zip
Back to top


10. JavaPOS

Summary: This sample demonstrates JavaPOS usage using the Java Runtime Environment.

Operating System: Platform Independant
Programming Language: Java
Topic: JavaPOS

Download Text Sample: TXT File JavaPOS.txt
Back to top


StarComm.NET Programming Samples:

In general, writing code for StarComm.NET would work very similarly to writing code for StarComm.
The syntax is slightly different depending on what language you're using, but the arguments and methods
used should be identical. For example, to print red text to a two color capable printer in StarComm,
the syntax is as follows:

[Visual Basic 6]
' Enable two color mode
StarComm1.StarComm_Output Chr(&H1B) & Chr(&H1E) & Chr(&H43) & Chr(&H31)

' Set the color to red
StarComm1.StarComm_Output Chr(&H1B) & Chr(&H1E) & Chr(&H63) & Chr(&H31)


While in the .NET languages, the syntax looks like this:

[C#]
// Enable two color mode
StarComm1.StarComm_Output("\x1B" + "\x1E" + "\x43" + "\x31");

// Set the color to red
StarComm1.StarComm_Output("\x1B" + "\x1E" + "\x63" + "\x31");

[Visual Basic.NET]
' Enable two color mode
StarComm1.StarComm_Output Chr(&H1B) & Chr(&H1E) & Chr(&H43) & Chr(&H31)

' Set the color to red
StarComm1.StarComm_Output Chr(&H1B) & Chr(&H1E) & Chr(&H63) & Chr(&H31)


For additional help with in-house applications that will print to Star printers
in the languages Visual Basic 6, Visual Basic.NET, C#, C++, C, or Java please
contact:

Star Customer Support
732-623-5500 x105

 
Products | Support | Drivers | News | Events | About Star | Contact | Site Map | Home
© 2003 Star Micronics, Inc. All rights reserved. Reproduction in whole or in part without permission is prohibited.
Privacy Statement | Terms of Use