Installing ActiveX Client Control
1. Install the Loftware Print Server (LPS). Refer to Chapter 1 for instructions on how to do this. Please note that the LPS can be installed on any 2000/2003/XP Professional computer anywhere on your LAN or WAN.
2. Perform a client install of the ActiveX Control as described in this chapter.
3. Configure all connected printers (using Label Design Mode) on the Server as described in Chapter 2 of the LLM User’s Guide.
4. Design the necessary label formats (using Label Design Mode) on the server.
You may also design them on any client PC and either share the files on the server or copy the files to the server when done. The Options | File Locations menu in label design mode allows you to set network locations for your design files. This allows you to design on a client PC while your labels are saved to the PC specified, usually the LPS PC.
5. Verify that the LPS is working by building a simple label and manually creating a .pas file for it. Copy your pas file to the directory that LPS is scanning and your label should print. If it does not, refer to Chapter 1 for ideas on troubleshooting.
Using ActiveX Client Control
1. Install the ActiveX Client Control on a client PC.
2. Load a sample program, learn, and study it. (This saves you time in the long run.)
Sample programs are installed with the LPS. They are also present in a subdirectory called sample programs.
3. Create a project in a programming tool that can utilize ActiveX Controls.
4. Add the Loftware ActiveX Client Control to the new project
5. Initialize the control by setting the PrinterPath, DropDirectory, .LabelsPath, and LayoutPath properties.
6. Choose a label by invoking the SetLabelName Method.
7. Set field data by using the SetData Method.
8. Print the label format directly by using the PrintJob Method.
Note: If your label does not print, try stopping the LPS scanning process to see if the control writes a .pas file to the directory specified with the DropDirectory Property.
Helpful Hints and Common Mistakes
Note: It is critical that you trap error events. This is especially true if the LPS server is running in a clustered environment and a failover occurs. Many of the ClientX methods throw critical errors during the failover transition. See the Error Event section at the end of this chapter for more information.
· Do not set any Path properties of the control until you have a valid LPS installation. The control throws ErrorEvents if it cannot find the paths that you set.
· Make sure that you have some labels designed and printers configured on the LPS before trying to use the PrintJob Method.
· Make sure you trap errors and display the error string in the ErrorEvent. This saves considerable debug time.
· Verify that the LPS is working by building a simple label and manually creating a .pas file for it. Copy your pas file to the directory that the LPS is scanning and your label should print. If it does not, refer to Chapter 1 for ideas on troubleshooting.
· You may want to add a multi-line list box to your application that you can add a line to for each WarningEvent and InfoEvent. This provides valuable information that helps you get up and running quickly. When you have reached a level of confidence, you do not need to display these events.
· ActiveX Client control does not allow you to assign a drop directory to any directory that does not contain the subdir /status. The result is an error dialog. If you try to execute the Visual Basic application anyway, it shuts down, and you must ‘end task’ on the Visual Basic program, reload it, and revert to the last code save. For more information on drop directories and the ActiveX Client Control, see Knowledge Base Article #42715 on Loftware’s website.