Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Illegal operation errors when changing between printers
Message
From
30/11/2002 12:43:01
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00721711
Message ID:
00728369
Views:
10
>Hi Ed,
>Just curious about the suggestion to use the _fpreset function. What's your thinking on this? BTW, I use your DIRPRTCLASS lib and it is great. Too bad printing in VFP is such mess that you even need it, but it has made my DOS app conversion into a managable project instead of: 1) program, 2) drinking binge to numb brain, 3) recover from binge, 4) repeat as needed.

Some printer drivers do not properly reset the FPU/MMX registers after a call to the GDI printer driver layer; while most apps aren't affected, VFP does make use of the FPU at times, and may become FUBAR when faced with an inconsistent FPU state, usually after making >1 call to the printer driver - this is why many HP-originated printer drivers malfunctioned with VFP but seemed OK with many other apps. _fpreset() sets the state of the FPU to a known, predictable condition, and as a result, VFP is not affected if you explicitly call _fpreset() every time following a call to the printer driver. A change to VFP's base behavior was introduced in VFP6 SP3 or SP4 that caused VFP to perform the reset prior to using the registers at a very small cost in performance, so late SPs of VFP6 and VFP7 and on are less affected by non-compliant printer drivers - there are other 'shortcuts' that driver authors can take that might cause problems, but not with the frequency and regularity of the inconsistent FP state.

DIRPRTCLASS works because it never calls the GDI - it talks directly to the spooler without the printer driver getting into the act at all; while this means having to take responsibility for some of the rendering tasks performed on a hardware-independent basis by the GDI, it also means that the GDI can't screw you up, and the normal Windows behaviors taken to preserve the state of the print device context like pagination and pritn state reset are avoided.


>Rich
>
>>>A customer of mine has both a Brother Laser printer and an Epson tmt 88 printer on a Point Of sale pc. I regularly get an illegal operation error
>>>after printing to the laser printer which is on a second Printer card in the pc. I am operating win 98. I have to switch between printer to open the cash drawer which is opening vis the epson printer .Has anybody experienced any similar difficulties
>>
>>You might want to try calling _fpreset() between printer calls; alternatively, if your handling of the POS printer involves direct print codes, you might try using my DIRPRTCLASS to handle the POS printer outside the normal VFP print environment.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform