Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting a printer with net use
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Selecting a printer with net use
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01025501
Message ID:
01025501
Views:
89
Hi.
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..

Any help?
Next
Reply
Map
View

Click here to load this message in the networking platform