Excellent - exactly what I was after, thanks muchly...

Regards
Paul McKenzie

=========================
Paul McKenzie
Jetbet II Developer
=========================
[EMAIL PROTECTED]
Ph: (04) 576-6822

T.A.B. National Office
106-110 Jackson Street
Petone
New Zealand



____________________Reply Separator____________________
Subject:  Re: [DUG]:  UNC Path Names
Author:   [EMAIL PROTECTED]
Date:          16/11/2001 13:17





     > Sorry Paul I don't know the answer, but assume that you will probably
     have
     > to iterate through the drives and look for a match for matching UNC name.

     right.

     you use WNetOpenEnum to set up an enum of RESOURCETYPE_DISK resources.
     then call WNetEnumResource to get them.   You get back a NETRESOURCE
     structure for each resource.

     NETRESOURCE has the localname and remotename so you can search through
     these pairs to find one matching your UNC path.

     Note that it's possible to have more than one drive mapped to the
     same UNC path so this mapping isn't well defined  (the drive letter
     mapped to \\mybox\myshare needn't be unique.

     BTW the inverse mapping is much more straightforward - just use
     WNetGetConnection.

     WNetGetConnection maps local names (i.e. mapped drive letters) to
     the UNC name of their corresponding network share.   This is
     unique (the UNC name associated with a mapped drive letter is
     well defined) so somewhat less trouble.


     -ns
     http://www.roserox.co.th


















     >
     > The ExtractFileDrive is meant to extract the drive letter from a file
     name
     > eg. D:\MyDir\Stuff.txt -> D:\
     > \\MyServer\MyDir\Stuff.txt -> \\MyServer\MyDir
     >
     > Regards,
     > John
     >
     --------------------------------------------------------------------------
     -
     >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
     >                   Website: http://www.delphi.org.nz
     > To UnSub, send email to: [EMAIL PROTECTED]
     > with body of "unsubscribe delphi"
     > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
     >

     ---------------------------------------------------------------------------
         New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                       Website: http://www.delphi.org.nz
     To UnSub, send email to: [EMAIL PROTECTED]
     with body of "unsubscribe delphi"
     Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/(See
attached file: att1.eml)

Attachment: att1.eml
Description: Binary data

Reply via email to