PRB: "API Call Caused an Exception" Error Message with Third-Party Print Drivers (253356)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 6.0, when used with:
- the operating system: Microsoft Windows 95
- the operating system: Microsoft Windows 98
This article was previously published under Q253356 SYMPTOMS
When using a Hewlett Packard LaserJet 4000 PCL5e or other third-party print driver, a non-fatal error can occur:
API call caused an exception
CAUSE
The third-party print drivers are not resetting the floating point coprocessor.
RESOLUTION
Here is a workaround to the behavior. The error message "API call caused an exception" is trappable and reports an error number of 2028. The error can be
handled by placing an _fpreset() function call and a retry command in an error-handling procedure. The following code demonstrates the basic structure
for trapping this error:
DECLARE _fpreset IN MSVCRT20.DLL
ON ERROR DO errHand WITH ERROR()
SET LIBRARY TO HOME()+"foxtools.fll"
SET PRINTER TO GETPRINTER()
? _wfindtitl("Command") && Error occurs at this point
PROCEDURE errHand
PARAMETERS _lcError
DO CASE
CASE _lcError = 2028 && API call caused an exception
_fpreset()
RETRY
OTHERWISE
ERROR _lcError
ENDCASE
ENDPROC
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
183522 FIX: Divide by Zero Creates Err with Third-Party Print Drivers
182137 PRB: Memory Error with HP LaserJet 4000 TN PCL 5e Driver
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | kb3rdparty kbprb kbprint KB253356 |
---|
|