Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting a printer with net use
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01025501
Message ID:
01025508
Vues:
14
IF WSH is an option
oNet = CreateObject("WScript.Network")
oNet.AddPrinterConnection("LPT1", "\\ADMINISTRACION\laserjet", .F.)
Otherwise, see NETRESOURCE structure class File #9502

>I need to capture (NET USE) a printer depending on a value stored in a table (mydata.dbf)..
>I've tryed this:
>
>
>DECLARE INTEGER ShellExecute IN shell32.dll ;
>INTEGER hndWin, ;
>STRING cAction, ;
>STRING cFileName, ;
>STRING cParams, ;
>STRING cDir, ;
>INTEGER nShowWin
>if mydata.impresora="01"
>     cFileName = "NET USE LPT1: \\ADMINISTRACION\laserjet"
>else
>     cFileName = "NET USE LPT1: \\ADMINISTRACION\epsonlx"
>endif
>cAction = "open"
>ShellExecute(0,cAction,cFileName,"","",1)
>
>
>
>But it doesn't work..
>I'm shure the mistake is when assigning the cFileName parameter, but i don't know how to work with it..
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform