Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drive letter
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00099536
Message ID:
00103013
Views:
30
>If I know the name of a server and the shared drive for example \\ntserver\drivec , how can I found out the drive letter that is assigned to it? Assuming that it maybe mapped differently on each Win95 workstation.
>
>Thanks
>Matt

Matt,

As George suggested you you should use the WNetGetConnection() API service. Here is the code of FOCUS.FLL function that does it for you.

FOCUSFNC FW_NET_GetConnection( XBASE_PARAMETERS )
/*---------------------------------------------*/{
char cRemoteName[MAX_PATH];
DWORD Len = MAX_PATH;

_initparc(1);
if (WNetGetConnection( _parc(1),(LPTSTR) cRemoteName,(LPDWORD) &Len ) == 0)
{
_retc( cRemoteName );
}
else
{
_retc( "" );
}
_deinitparc(1);
FOCUSFNCRETURN();
}

You can download FOCUS.FLL from the web site of FastWrite : http://www.FastWrite.com/Focus/Focusfll.htm

This library is free. Go for it.

Pat
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform