Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing Problems
Message
De
19/03/2001 23:04:25
 
 
À
19/03/2001 09:34:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00485340
Message ID:
00486742
Vues:
12
>Hi Jorge,
>
>Actually the situation is a little different from what I first described. The Station residing on a network has 2
>parallel ports in it configured to LPT1 & LPT2. The Station's program (Foxprow 2.6) needs tobe able to set
>default printer (locally) to either parallel port or to a networked printer on the fly. We need the 2 parallel ports to be able to
>print to 2 printers at the same time. The problem we've noticed with Windows 2000 is we aren't able to set the
>default printer without manually doing it, we need tobe able to do this from with foxprow 2.6 code.
>

You could launch a small piece of VBScript that uses the Wscript.Network COM object to redefine the default Windows Printer - you'd use RUN to fire a .BAT file, and have the .BAT run the script by invoking either CSCRIPT or WSCRIPT to run the script for you, since FPW doesn't support COM directly.

An alternative would be to map the network printer to a local printer port (via NET USE) and then address the printer by port name in your FPW app. FPW does support Windows printer names, but does not support many of the names that are legal under the Win32 environment, since Win16 didn't handle many issues related to LFNs. NET USE allows you to map several network printers to local resources, regardless of their UNC, and you can assign the PRN: device to any defined local port, so that it becomes your 'default' printer.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform