Gets the information available about a LEADTOOLS Virtual Printer Driver from the system.
#include "Ltprinter.h"
L_LTPRINTER_API L_INT EXT_FUNCTION L_PrnGetPrinterInfo(pszPrinterName, pPrnInfo)
Character string that contains the name of the LEADTOOLS Virtual Printer.
Pointer to a PRNPRINTERINFO structure that contains the LEADTOOLS Virtual Printer Driver information that was used when installing the printer.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function does not fill the pPrnInfo->pszPassword member. The password is always returned as NULL.
When the PRNPRINTERINFO structure is no longer needed, call L_PrnFreePrinterInfo to free the memory allocated for the information.
Win32, x64.
L_INT GetPrinterinfoExample()
{
L_BOOL bLEADTOOLSPrinter = FALSE;
L_INT nRet = L_PrnIsLeadtoolsPrinter(TEXT("TEST LEADTOOLS Printer"), &bLEADTOOLSPrinter);
if(nRet != SUCCESS)
return nRet;
if(bLEADTOOLSPrinter == TRUE)
{
PRNPRINTERINFO info;
memset(&info, 0, sizeof(PRNPRINTERINFO));
info.uStructSize=sizeof(PRNPRINTERINFO);
// Get the printer info
nRet = L_PrnGetPrinterInfo(TEXT("TEST LEADTOOLS Printer"), &info);
if(nRet != SUCCESS)
return nRet;
// Display the Printer EXE
MessageBox(0, info.pszPrinterExe, TEXT("TEST LEADTOOLS Printer"), 0);
// Free the printer info struct
L_PrnFreePrinterInfo(&info);
}
return nRet;
}
L_INT GetPrinterinfoExample()
{
L_BOOL bLEADTOOLSPrinter = FALSE;
L_INT nRet = L_PrnIsLeadtoolsPrinter(TEXT("TEST LEADTOOLS Printer"), &bLEADTOOLSPrinter);
if(nRet != SUCCESS)
return nRet;
if(bLEADTOOLSPrinter == TRUE)
{
PRNPRINTERINFO info;
memset(&info, 0, sizeof(PRNPRINTERINFO));
info.uStructSize=sizeof(PRNPRINTERINFO);
// Get the printer info
nRet = L_PrnGetPrinterInfo(TEXT("TEST LEADTOOLS Printer"), &info);
if(nRet != SUCCESS)
return nRet;
// Display the Printer EXE
MessageBox(0, info.pszPrinterExe, TEXT("TEST LEADTOOLS Printer"), 0);
// Free the printer info struct
L_PrnFreePrinterInfo(&info);
}
return nRet;
}