Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating a network connection
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00434820
Message ID:
00435008
Views:
19
>I've used this function quite a bit in the past. Off the top of my head, my declaration and execution of the call look like this.
DECLARE INTEGER WNetAddConnection IN Win32API;
>  STRING @lpszRemoteName, STRING @lpszPassword, STRING @lpszLocalName
>lnresult = WNetAddConnection(@cResource, 0, @cDriveLetter)
IOW, the strings should be passed by reference. To pass a null pointer for the password, use 0 rather than an empty string.

Warning: WNetAddConnection is officially obsoleted; I'd recommend replacing calls to it with calls to WNetAddConnection2(0 or WNetAddConnection3() (there's sample code in my NETRESOURCE class, and I think in Christof's STRUCT class, both in the Files section, and there's this little-known item in the WSH Wscript.Network call MapNetworkDrive; I think you might have heard rumors about it...
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform