Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Terminal services printing issue
Message
 
To
17/04/2007 16:13:05
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01216955
Message ID:
01217026
Views:
9
>>>>>I don't see simple solutions anymore. So there are two more complicated (just a bit).
>>>>>The first one would be to reset Windows default printer (programmatically), and then use Set Printer To Default command. Would you like to try?
>>>>
>>>>I'll play around with some work-arounds a bit. I don't hold much hope, however.
>>>>Thanks for your assistance.
>>>>Allen
>>>
>>>It seems you misunderstood. Do you want to get code how to switch Windows printer programmatically so you will use it and then SET PRINTER TO DEFAULT in your code?
>>
>>Oh. yes thanks.
>>Allen
>
>
>Function resetwindowsprinter
>Lparameters cPrintername
>If printerexist(cPrintername)=.F.
>	Return .F.
>Endif
>Declare Integer SetDefaultPrinter In WINSPOOL.drv String
>If SetDefaultPrinter(cPrintername)<=0
>	Clear Dlls
>	Return .F.
>Endif
>Clear Dlls
>Return .T.
>Endfunc
>
>Function printerexist
>Lparameters cPrintername
>Local nLoop
>Local Array aTemp(1)
>If Empty(cPrintername)
>	Return .F.
>Endif
>If Aprinters(aTemp)<=0
>	Return .F.
>Endif
>For nLoop=1 To Alen(aTemp,1)
>	If Upper(Alltrim(aTemp[nLoop,1]))==Upper(Alltrim(cPrintername))
>		Return .T.
>	Endif
>Endfor
>Return .F.
>Endfunc
>
great. Thank you very much.
Allen
Previous
Reply
Map
View

Click here to load this message in the networking platform