Error 2028: API call caused an exception

If you are a VFP developer and have any questions about using our products from VFP here is the place to post them.
Post Reply
csl
Posts: 1
Joined: Fri Mar 28 2003

Error 2028: API call caused an exception

Post by csl »

I have an FoxPro app which runs concurrently on 8 servers generating a report as a PDF. I am running VFP6 (SP5) and PDF Converter 1.59. When I run the following code:

SET LIBRARY TO '.\FLLINTF.FLL' ADDITIVE
loPDF = PDFDriverInit("PDF_Printer")
=FileNameOptions(loPDF, 1+2)

the third line returns error 2028. However, some days I get no errors at all, some days all calls on a particular server return the error and some days all calls on all servers return the error. The app is running under NT and I am assured by the administrator that the logon is identical on each server and in each case has full domain rights (including printer driver creation). Can anyone help explain the inconsistencies I am experiencing?

Many thanks,


Danny
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

As I can see from your explanation, you are in a multithreading environment. At some statges two or more applications try to write to the printer in the same time, which generates an error or possibly some overwritten files.

To overcome this issue you can use the locking mechanism available in version 2 of the driver.
The lock() / Unlock() functions ensure that only one print job is send to the printer at a specific time and one command is setting the printer properties at a specific time.

To try this please download the latest version of the driver from www.amyuni.com, you will also find along with the new demo a complete documentation, please check 'Common Driver Interface 210.pdf".

To have a sample code on using the locking mechanism please download our VFP technical note from:http://www.amyuni.com/en/support/technotes.html

Hope this helps :)
Post Reply