Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP Freezing

Status
Not open for further replies.

mm0000

IS-IT--Management
May 19, 2002
295
IN
VFP and the whole system freezes after running some of my reports - windows just hangs. Pressing Ctrl + Alt + Del does not reset my computer - have to reset the reboot switch. Anyone else faced the same problem ? - would be of immense help if anyone knows how they solved the problem.

 
What printer do you have? Is it an HP? What version of VFP are you running? Have you installed the LATEST service pack?

Printing problems are almost always realted to the printer driver. The HP drivers are particularly awful. The latest service pack for VFP 6 has a workaround in it for most of the problems caused by the HP drivers.
 
If it's a printer related problem you may want to put this in your main program:

DECLARE _fpreset in MSVCRT

And everytime you need to print use this (BEFORE and AFTER you print:

=fpreset()

Sometimes the floating point doesn't clean itself properly after a print job.

 
do i need to add this before every print and preview or just print.

=fpreset()
do form abc.frx to printer prompt
=fpreset()

=fpreset()
Report form abc.frx preview nowait
=fpreset()
 
I am getting an error saying unable to find unknown fpreset when i compile the program. I have
DECLARE _fpreset in MSVCRT (in my main.prg)

and = fpreset() before and after every time i issue a report for statement.
 
Shangrilla

It depends on the version you have on your system. Look in your windows directory for any files with MSVRT* and reset to the version you have. I have seen systems that have MSVRT,MSVRT20 AND MSVRT40.

asm338s

Yes it is recommended since your previews also use the printer driver.
 
Magnon
I am using VFP 6 with SP5 - all the reports I ran were in print preview mode (and the default printer is an HP Laserjet 8000) however I have made the changes and will keep this thread updated if it has been solved in due course.
 
Shangrilla

There is a typo in my previous post . The DLL is MSVCRT (and not MSVRT as I wrote)

mm0000

Hope it solves your problem. BTW just to clarify things I rechecked my code (I haven't looked at that part of my app in a long time) the two lines needed are

DECLARE _fpreset in MSVCRT (Or whatever version you have, Declare it once in the main prg)

And every time you run a report (BEFORE and AFTER)
=_fpreset() (Note the underscore and it is case sensitive)



 
I have all 3 msvcrt, msvcrt20 and msvcrt40. which one should i use?
 
mgagnon
I have tried it with msvcrt however I am still getting the freezes (albeit maybe less regularly but cannot tell for sure) i had noticed the typo and the missing '_' in the function, however i will now try with msvcrt40
 
mm0000

I would also try a more Generic HP printer driver then the one supplied with the printer (or from HP), I would try one that comes with Windows.
 
I looked at the time stamps on the msvcrt files and the msvcrt.dll had the lastest timestamp the others 40 .... 20 had progressively earlier time stamps (and therefore were earlier versions of the file) and have therefore decided not to try the msvcrt40 file. I could try a more genric print driver but a user wanting to print a report would have to re-select the correct print driver whenever he fired a report to print - which would not solve the problem.

I do not know whether the problem is beascuse of running multiple print preview reports - since I am testing the app I dont actually print the reports but keep viewin ghtem in print preview mode. Is it possible to specify automatically a different print driver for print preview mode without having the user select the printer.
 
mm0000
>Is it possible to specify automatically a different print driver for print preview mode without having the user select the printer.

Yes, just remove the information contained in the Expr,Tag1,Tag2 fields of the report:
Code:
use myReport.frx 
LOCATE FOR objType = 1 AND objCode = 53
REPLACE Expr WITH SPACE(0)
REPLACE Tag1 WITH SPACE(0)
REPLACE Tag2 WITH SPACE(0)

and use the APRINTERS() functions to determine the available printers on the system and use SET PRINTER TO whatever printer driver you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top