Hi,
In my wx application, I browse for directory where user selects the directory which may be shared. I path to convert the selected path to network path,
(e.g E:\Shared\Doc to \\RUDRESH\Shared\Doc) if it is shared.
I couldn't figure to do so. Please suggest.
Thnaks,
R.
[wxMSW][wx3.0.2]Getting network path of directory
Re: [wxMSW][wx3.0.2]Getting network path of directory
I assume you mean the situation when a remote share is mapped to a local drive letter? And then you want to find the "real" network path?
I don't think there is any wxWidgets function for this.
This Windows function looks promising, but i haven't tried it:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
I don't think there is any wxWidgets function for this.
This Windows function looks promising, but i haven't tried it:
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Use the source, Luke!
Re: [wxMSW][wx3.0.2]Getting network path of directory
Thanks for the reply.
If I shared a folder (i.e E:\\Shared) on my machine, I can access it as "\\RUDRESH\Shared" or "\\192.168.43.46\Shared" on same machine or from other machine on LAN. By network path I meant "\\RUDRESH\Shared" or "\\192.168.43.46\Shared".
When user selects "E:\\Shared" through browse of directory, I want to make it as "\\RUDRESH\Shared".
I tried the function you said but I always get ERROR_NOT_CONNECTED. It description says - "The device specified by the lpLocalPath parameter is not redirected." Not sure how to fix this. I can access that path from other machine.
Thanks,
R
If I shared a folder (i.e E:\\Shared) on my machine, I can access it as "\\RUDRESH\Shared" or "\\192.168.43.46\Shared" on same machine or from other machine on LAN. By network path I meant "\\RUDRESH\Shared" or "\\192.168.43.46\Shared".
When user selects "E:\\Shared" through browse of directory, I want to make it as "\\RUDRESH\Shared".
I tried the function you said but I always get ERROR_NOT_CONNECTED. It description says - "The device specified by the lpLocalPath parameter is not redirected." Not sure how to fix this. I can access that path from other machine.
Thanks,
R
Re: [wxMSW][wx3.0.2]Getting network path of directory
Hi,
What are you using to access that path? wxDirPicker? wxFileDialog? Or you are trying the hardcoded way?
Thank you.
What are you using to access that path? wxDirPicker? wxFileDialog? Or you are trying the hardcoded way?
Thank you.
Re: [wxMSW][wx3.0.2]Getting network path of directory
Once the user selects the path (i. e E:\\Shared) through wxDirPickerCtrl. I use hardcoded way assuming it is shared. That's what I what to do through code. I want a function which gives me path like "\\RUDRESH\Shared" when "E:\\Shared" is passed if it is shared with in LAN.ONEEYEMAN wrote: What are you using to access that path? wxDirPicker? wxFileDialog? Or you are trying the hardcoded way?
Thank you
R.
Re: [wxMSW][wx3.0.2]Getting network path of directory
I tested the code from the link i posted and it worked fine for me.
I have a remote PC named "W7X64" with a share "xx".
I map the share to the drive letter Y
I call the function with the path "Y:\" and it returns "\\W7X64\xx" as "Universal name".
I have a remote PC named "W7X64" with a share "xx".
I map the share to the drive letter Y
I call the function with the path "Y:\" and it returns "\\W7X64\xx" as "Universal name".
Use the source, Luke!