JazzyKat


Hello,

We have a Visual Foxpro 6 application used on several computers. On one machine, and only this one, one of the report often crashes with the error "access violation in VFP6R.DLL"

The computer configuration is:
Windows XP sp 2
Visual Foxpro 6 executable

Other computers using the same report have no problem. I`ve read on this forum and on other newsgroups that it may be caused by memory corruption in the form initialization/loading events but I`m quite at loss on why on this machine it will crash 8 times out of 10 and never on the others.

I`ve narrowed the culprit code to the GetPrinter() line. The dialog is not shown, something happens while the Foxpro environment grabs the printer defined on the computer.

Thanks in advance to anyone who has a suggestion,

Eric



Re: GETPRINTER() causes access violation in VFP6R.DLL

Naomi Nosonovsky


Hi Eric,

Hard to really suggest anything, but I've seen crashes with the bad report (corrupted table) sometimes.

So, first I would start with making sure the report table (frx/frt) is OK (or may be selecting everything from the report, creating a new report and re-saving).

Secondly it may be related to bad network connection and network printers.

Finally, it may be caused by bad printer driver. The general advice I've seen was to install generic MS driver for HP printers instead of its own printer driver.

There is also an advice to use _fpset() before calling a report (it is usually advised for "Error loading printer driver", though).

Good luck!






Re: GETPRINTER() causes access violation in VFP6R.DLL

dni

You may try to have installed the last version of HP printer driver.





Re: GETPRINTER() causes access violation in VFP6R.DLL

JazzyKat

The local printer on that computer has an HP pritner with the latest driver. But my problem is even before getting to the report. Thanks anyway for the feed-back.




Re: GETPRINTER() causes access violation in VFP6R.DLL

JazzyKat

Hello Naomi, thanks for the suggestions. I'm not worried about the report as the user doesn't get there when it crashes. I haven't found the _fpset command. Was this available in VFP6 The local printer on that computer is an HP but the user doesn't even get there when it crashes.

Regards,

Eric





Re: GETPRINTER() causes access violation in VFP6R.DLL

Naomi Nosonovsky

If this is an HP printer, then it is very possible to be a bad printer driver.

_fpreset is Windows API function, I misspelled it from memory, sorry.

Code Snippet

declare _fpreset in msvcrt20.dll
=_fpreset()

BTW, I've searched on _fpreset on another site and found lots of threads with the problem similar to yours.

You may try googling on _fpreset.





Re: GETPRINTER() causes access violation in VFP6R.DLL

JazzyKat

This is probably not the right section to ask this but it`s related to this thread discussion... Are each printer drivers called when Windows build the Printer selection dialog-box I'm curious because most replies deals with bad printer driver and our problem pops before the printer selection window is displayed.

Thanks everybody for sharing your insight on this, truly appreciate it. I'm gonna try the fpreset call to see.




Re: GETPRINTER() causes access violation in VFP6R.DLL

Naomi Nosonovsky

I think that printer drivers are not called when Windows build the Printer selection dialog, though I may be incorrect.