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
Thank you so much for your review and comments.
Let me try this option and update if this works.
Thank you,Vijay
I tested by using this external function declarations and could successfully print the label to the printer.
Thank you so much!
For your earlier question, we would like to deploy this application as 64 bit. Do you see any issues on building the application as 64bit?
Thank you,
Vijay
The external function declarations I supplied SHOULD work in 64-bit, but I have way to verify. As for the rest of your application, I have no idea if you will encounter any additional issues. However, I have two recommendations:
1. Upgrade your PFC libraries. They are available for free download on Github: https://github.com/OpenSourcePFCLibraries
2. Thoroughly review the entire contents of the "Migrating 32-bit Applications to 64-bit" publication and follow all of the instructions:
https://docs.appeon.com/pb2022r3/migrating_32bit_applications_to_64bit/index.html
Would you please mark this question/issue as resolved? Many thanks.