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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crash of application sending "set printer to" with Windows 2000

Status
Not open for further replies.

RomeoM

Programmer
Oct 26, 2001
2
0
0
IT
hello,
i have a problem with my application written with Foxpro for Windows ver. 2.6a. I open communication with printer throught "??? ' '" command. When i send the command "set printer to" Windows 2000 close the application with this error: "Foxprow has generated a protecion .... in 0001:222d". My runtime and Foxprow.exe are patched with dzpatch, and i have not problem with report form..., and not problem with Windows 9x, just with Windows 2000.
do can someone help me?
thank you.
 
My first guess would be the W2K printer driver. See if you can get an updated or substitute one.

Rick
 
If you are talking about useing the SET PRINTER TO command without specifying anyting, i.e., to just set the printer back to whatever the default was, I have also had this problem on Win2k. I had better luck using:

SET PRINTER TO lpt1

just so windows doesn't get confused when there is no printer specified to set as the default.

Dave S.
 
thank you everybody,

for rgbean: at this moment i have installed a generic text only printer and a windows 2000 printer driver for epson sq1170 and with both my application crash.

for dsummzzz: i have tried your suggestion, but without success.
this is my code:
...
set device to print
set print to lpt1
??? " "
@ prow(),pcol() say chr(15) &&& or other setting commands
@ prow()+1,01 say "everything..."
...
...
...
eject
set print to
&&& after this command my application crash and don't print
&&& anything
set device to screen
...
...
 
What I meant was, after setting the printer to whatever print name it is then running the report, issue the SET PRINTER TO lpt1 after it has completed. In your above code, you might need to set the printer to a valid printer name to avoid the crash.

SET CONSOLE OFF
SET PRINTER TO NAME '\\fileserver\printer_name'
SET DEVICE TO PRINTER
SET PRINTER ON

??? " "
@ prow(),pcol() say chr(15) &&& or other setting commands
@ prow()+1,01 say "everything..."
...
...
...
EJECT
SET PRINTER OFF
SET PRINTER TO lpt1
SET CONSOLE ON
SET DEVICE TO SCREEN


Dave S.
 
I am having the same problem with recieving a GPF error and automatically terminating FoxPro as soon as the SET PRINTER TO stmt is read. I can print program code directly from the FoxPro Print Menu and can even print reports from other programs within my FoxPro application. On the one report that gives me this error, I have many variables stored in memory prior to printing. Did you ever figure out what was causing your crash problem?
 
HI
While I have not applied my mind for the probable causes for the printer error.. NOW THAT FoxPro age is getting older and older, newer generation of OS is bound to get into trouble. Friendsm it is time that we migrate soon .. sooner the better !... Also it will be handy to collect tools which can take the users a little more mileage...

The following could help.... Click on the link...
Here is an easy Print Spooler !
thread182-155776

This way, the printer stoping a while, not completely sending the output to printer.. etc can be avoided. A little application of mind into various options will help solve many things in that cute application.

Hope this is helpful :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Since we are in the subject of printers and win 2000, why is that when running fpw26 in win 2000 there is no option to print to a specific printer in the report designer window? If you set the option in previous versions of windows, this option will be overwritten and will be set to the current default printer and could prove disastrous for "Generic\Text Only" setting if you compile it in win2000. Any ideas?
 
FPW 2.6 under Win 2000 or any other OS is the same - when the report designer window is open, go to Menu -> File -> Print Setup, and choose a printer. When the report is saved, this is the setting that will be saved.

Are you suggesting that it works differently?

Rick
 
I have finally concluded my crashing problem is not with the SET PRINTER statement. I believe my problem has to do with the memory settings. We do not use the Report Generator, our reports are actually hard coded. When I try to print the reports that require a lot of memory variables, I am getting my GPF error and then get kicked out. I can't even print to a file. However, we installed FPD 2.6 on the Win 2000 server. Running the reports under the Dos version gives me no errors and runs fine. FPD26 eats the processer up on the Win2000 server, so this is not going to be a viable option. I have tried using the MEMLIMIT setting in the Config.FPW file, which didn't help on my GPF error in windows version. Does anybody else have any other ideas?
 
Hi Rick,

The problem with the print setup dialog is this:

From the Report Designer window, you would normally go to the Report >> Page Layout >> Print Setup and the Print Setup Screen will appear. Under Printer, You have two radio buttons:

1) Default Printer (currently "some printer name")
2) Specific Printer (with a choice of installed printers)

My problem is that in win2000, you only have option number 1 and when you print the report, It will find the current default printer instead of the assigned printer.

If I compile the exe in my win95 machine, it works fine in printing the report but if I execute this exe in my win2000 computer, it refused to run the report with the message "TTY.DRV Not Found" (If I use "Generic/Text Only" with the driver already installed) . You then would have to reopen the report and set the printer properties again. Even if I set it to "Generic Text" as the default printer, it will still print to HP LaserJet 2100, HP500 or whatever the default printer is.

Any suggestions??
 
I'd start by using the information in the following FAQ and strip out the default printer information from the report - remember you have to do this after anytime you modify the report. Note: While this FAQ was written for VFP, it works the same in all versions of FoxPro. faq184-581


Rick
 
Hi
While this may read odd...

I have faced unexpected problems working with FoxPro in W2000 OS. These problems surface, once the file size is larger. I have nothing to prove, but my experience.
So i was forced to migrate all those systems to WinMe which did not have these problems.

I attribute these problems, owing to the 32bit nature of W2000.

So I no longer advice any one working on FoxPro to upgrade to W2000. Before that, better they migrate out of any DOS platform aplications.

I start thinking that the printer files created, spooled, may be crashing ..loosing... freezing.. whatever owing to the file creation manner of W2000 as against the methods used by FoxPro. How we can overcome this....... zzzzzzzzz..

ramani ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top