Link to home
Start Free TrialLog in
Avatar of hatecapletters
hatecapletters

asked on

NT/Internet problems Part 2

An application with a TClientSocket component sends a full path (incl. filename) to an application with a TServerSocket component on another machine. How do I convert the full path to the "shared" path (eg. d:\work\test.exe might be machinename + d_drive\work\text.exe for the receiving machin) ?

This has to work under NT 4.0, and I cant tell the shared names in advance

If you have an idea, please include one or more examples, as I'm not that strong on this side of delphi

 
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Madshi
Madshi

Perhaps there's a share enumeration component available on torrys?

http://www.torry.ru
This code translates the mapped drive H: to a network recource path like \\machine\dir:

var buf: array[0..MAX_PATH] of Char;
    len: Cardinal;
begin
  len := MAX_PATH;
  WNetGetConnection(PChar('H:'), @buf, len);
  ShowMessage(buf);
end;
Avatar of hatecapletters

ASKER

epsylon >> sorry, but i keep getting an empty "buf" when i try that

madshi >> sounds like you are on the right track. I've tried to read up on wnetenumopen and wnetenumresource, but i'm too dense to get it right.. sombody out who can give me an example ?
i have to give you a "B" for this one, since I had to do a LOT of work myself ;-)
That's okay...   :-)

So did get it working now?