Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Windows Default Printer
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00216227
Message ID:
00218628
Views:
21
Well here's where we stand...
I wrote a simple program in VFP which sends the output of
SET("PRINTER",2) and APRINTERS()
to a text file.

Now I realize I have only part of the solution.

In 2.6 SET PRINTER TO whatever
does not alter the windows default printer...just where Fox sends stuff.
I knew that, honest, but forgot.

I now need help to actually alter the windows default printer setting, using almost any method...except user intervention.


>Thanks Fred, but that's not it...the printer definition is ok...it's the same printer we developed with. We just have some quarky behavior and the only identified fix so far requires us to toggle the default printer setting...Change to something else, change back, then print
>
>Rick
>---------
>
>>>Is there any way of Detecting Windows Default Printer?
>>>
>>>(BTW - I'm using NT)
>>>
>>>I have an app that sometimes prints wrong...but I noticed that if I toggle my default printer to something else, and then back to the original, then it prints correctly.
>>>
>>>What I'm doing is printing a report with multiple graphs. The graphs are produced using Graphics Server. To get things the way we want them we play with the FRX. Because of this, we have a "template" of the report, which we copy and modify. Part of the modification is to insert a record for each graph. Each report is uniquely re-named during the copy of the template. Each graph is stored as a BMP and is also uniquely named.
>>>
>>>So if I do two reports (A and B), I'll have at least three graphs each (G1a, G2a, G3a, and G1b, G2b, and G3b)... Each Graph is the result of an independant call to Graphics Server...
>>>I should get the following:
>>>Report A with Graphs G1a, G2a, G3a
>>>Report B with Graphs G1b, G2b, G3b
>>>
>>>
>>>Sometimes, if I don't toggle the default printer I'll get
>>>Report A with Graphs G1a, G2a, G3a
>>>Report B with Graphs G1a, G2a, G3a
>>>
>>>But if I do toggle the default printer I'll get
>>>Report A with Graphs G1a, G2a, G3a
>>>Report B with Graphs G1b, G2b, G3b
>>>....Like I'm supposed to!
>>>
>>>We've checked everything "we" can think of and toggling the printer is the only thing that has worked so far...
>>>...No, we don't know why it works
>>>...No, we don't know why it prints wrong either.... :(
>>>(I believe the FRX has the right entries...I'll double check)
>>>
>>>So that's why I'm asking,
>>>Is there any way of Detecting Windows Default Printer?
>>>
>>>BTW - I'm told the info is in the NT Registry...how can I get there with 2.6? Any working solution is GREAT!!!! If you have an answer that doesn't involve the registry Please tell me! Don't hold back!
>>
>>
>>If you are always trying to print to the default printer, you should be able to do this:
>>
>>Open your .FRX file like a table (USE myreport.FRX)
>>For the first record, you should blank the EXPR, TAG, TAG2 memo fields.
>>
>>Now, when you try to run the report, it should go to the default printer.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform