Programming with the LEADTOOLS Network Virtual Printer Client Installer Application

Take the following steps to create and run a program that uses the LEADTOOLS Network Virtual Printer Driver.

1.

Start Visual Studio 2008.

2.

From the main menu, choose File->New->Project...

3.

In the New Project dialog box, choose Visual C++ in the Projects Types, and choose MFC Application in the Templates.

4.

Type the project name as LEADTOOLS Printer Client Installer in the Project Name field.

5.

In the Location field, use the Browse button to navigate to the Examples subdirectory (such as C:\LEAD Technologies\LEADTOOLS 19\Examples\CDLL). Uncheck both Create directory for solution and Add to Source Control options. Click OK.

6.

Click Next> in the MFC Application Wizard.

7.

Select dialog based application type. Then click Finish. Three folders will be created, entitled: "Header Files", "Resource Files", and "Source Files".

8.

From the main menu, choose Project->Properties.

9.

In the Properties dialog box, choose Configuration Properties then select C/C++ then select Preprocessor.

10.

In right side set Preprocessor definitions property to use LTVXX_CONFIG then click OK.

11.

In Solution Explorer, open stdafx.h and add the following code at the end of it:

#include "..\..\..\Include\LtprinterClientInstaller.h" 

12.

In the Source Files, right -click on the folder. Choose Add->New Item. Choose Code in Categories, and C++ File(.cpp) in Templates. Type Imports in the name field and click Add.

13.

Right click on Imports.cpp and click Open. Add the following code:

#include "stdafx.h" 
#if defined(WIN64) 
   #pragma comment(lib, "..\\..\\..\\Lib"L_VER_DESIGNATOR"\\cdll\\x64\\LtprinterClientInstaller_x.lib") 
#else 
   #pragma comment(lib, "..\\..\\..\\Lib"L_VER_DESIGNATOR"\\cdll\\win32\\LtprinterClientInstaller_u.lib") 
#endif  // #if defined(WIN64) 

14.

Right-click on LEADTOOLS Printer Client InstallerDlg.h and click Open. Add to it the following code:

//add the following function definition to the CLEADTOOLSPrinterClientInstallerDlg functions 
   afx_msg void OnBnClickedOk(); 

15.

Right-click on LEADTOOLS Printer Client InstallerDlg.cpp and click Open. Add to it the following code:

//locate BEGIN_MESSAGE_MAP and add the following line 
ON_BN_CLICKED(IDOK, & CLEADTOOLSPrinterClientInstallerDlg::OnBnClickedOk) 
 
 
afx_msg void CLEADTOOLSPrinterClientInstallerDlg::OnBnClickedOk() 
{ 
   /* 
   "Printer Name" : the name of a shared printer on the server machine 
   "Printer DLL" : printer demo DLL 
   "Printer Server" : the name of the printer server 
   */ 
   L_PrnClntSetPrinterConnectionDll("Printer Name", "Printer DLL", "Printer Server"); 
} 

16.

Compile and run the code to test it, the printer selected will be connected and installed to the machine.

For more information, refer to:

Working with the LEADTOOLS Virtual Printer

See Also

Tutorials

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help