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.


Start Visual Studio 2008.


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


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


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


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.


Click Next> in the MFC Application Wizard.


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


From the main menu, choose Project->Properties.


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


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


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

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


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.


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") 
   #pragma comment(lib, "..\\..\\..\\Lib"L_VER_DESIGNATOR"\\cdll\\win32\\LtprinterClientInstaller_u.lib") 
#endif  // #if defined(WIN64) 


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(); 


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"); 


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


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