>On occasions my users get an error 2028...
>"API call caused an exception."
>
>It invariable occurs just after a print job, that might switch the default printer, where I call the Foxtools Words() function shortly afterward.
>
>I can work around it by running this code just before the error would normally occur.
>
>
onErr= on('ERROR')
>on error *
>words('abc def')
>on error &onErr
>
>Once Words() errors it runs fine the next time. Very weird! Has anyone seen this?
>What the heck has Words() got to do with printing??
Not much, but FoxTools makes use of a bunch of APIs that are associated with the GDI, that part of Windows dealing with video and printer drivers, and my guess is that one of the API calls used internally by FoxTools either has a problem with one of your graphics drivers, the state of the machine after returning from a call to something that calls the print or video driver and can't deal with the state of the machine, or a mismatch in the parameters passed to an API call between the OS version and the .DLL providing the service I recently ran into this trying to declare fprint() from MSVCRT and Win2K inside of VFP; try the following:
DECLARE INTEGER fwrite IN MSVCRT as _fw ;
STRING @ lpBuffer, INTEGER nSize, INTEGER nCount, INTEGER nFileHandle)
declare INTEGER GetStdHandle IN KERNEL32 INTEGER nStdHandle
? _fw('Hello, World',1,12,GetStdHandle(-11))
Using _lwrite() from KERNEL32.DLL doesn't melt down; I've assumed it's a problem with the copy of MSVCRT.DLL on the Win2K box.