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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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;
var buf: array[0..MAX_PATH] of Char;
len: Cardinal;
begin
len := MAX_PATH;
WNetGetConnection(PChar('H
ShowMessage(buf);
end;
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 ?
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 ?
ASKER
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?
So did get it working now?
http://www.torry.ru