Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force reconnection of a network mapped drive?
Message
 
To
21/10/2002 13:45:16
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00713586
Message ID:
00713609
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>GETDIR() doesn't return remoted mapped drives that are mapped, but not connected, as illustrated by their icon having a red X thru it in Explorer. This happens when the computer is started before the computer with the mapping is started before the computer with the drive.
>
>I'd like to show the drive in GETDIR(), by forcing the connection (if possible). If the drive really isn't available, then of course, it shouldn't show.
>
>TIA.

Hi Nancy.
This API function queries the mapped drive and supposedly tests the connection. I'm not sure it will force it, but you can give it a try

Regards
Jose
	DECLARE Long WNetGetConnection in WIN32API;
		STRING @lpzLocalName, ;
		STRING @lpzRemoteName, LONG @lpnSize
		
	lcLocalName = "T:"
	lcRemoteName = Space(255)
	lnSize = 255
	
	lnRet = WNetGetConnection( @lcLocalName, @lcRemoteName, @lnSize)
	
	* lnRet # 0 : not a mapped resource, or not connected, or other error
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform