- Vijay Kumar Natarajan
- PowerBuilder
- Wednesday, 14 February 2024 09:12 PM UTC
Hi,
We are trying to upgrade the application from PB12.5 to PB 2022 R2. Currently we are encountering the Label printing issue.
In PB12.5, the declared external function signature is working well. But in PB2022 R2 Version the same signature is not working.
Application uses winspool.drv External Function to Open, StartDoc, WritePrinter and ClosePrinter to print to the Label printer (Honeywell).
I am getting the handle when opening the Printer, but commands which are set to WritePrinter is not printed in the printer. Basically no response from the printer.
Please kindly provide how the signature of this external function needs to be modified.
External Function Declarations:
FUNCTION Boolean OpenPrinter( &
String PrinterName, &
REF ULong hPrinter, &
Long NULL) LIBRARY "winspool.drv" ALIAS FOR "OpenPrinterW"
FUNCTION Long StartDocPrinter( &
Long hPrinter, &
Long Level, &
Str_DocInfo pDocInfo) LIBRARY "winspool.drv" ALIAS FOR "StartDocPrinterW"
FUNCTION Long StartPagePrinter( &
Long hPrinter) LIBRARY "winspool.drv"
FUNCTION Long WritePrinter( &
Long hPrinter, &
String pBuf, &
Long cdBuf, &
REF Long pcWritten) LIBRARY "winspool.drv" ALIAS FOR "WritePrinter;Ansi"
FUNCTION Long EndPagePrinter( &
Long hPrinter) LIBRARY "winspool.drv"
FUNCTION Long EndDocPrinter( &
Long hPrinter) LIBRARY "winspool.drv"
FUNCTION Boolean ClosePrinter(Long hPrinter) LIBRARY "winspool.drv"
Thank you,
Vijay
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.