[wxMSW][wx3.0.2]Getting network path of directory

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Rudra
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Fri Sep 13, 2013 2:59 pm

[wxMSW][wx3.0.2]Getting network path of directory

Postby Rudra » Thu Jun 14, 2018 9:30 am

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.

User avatar
doublemax
Moderator
Moderator
Posts: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: [wxMSW][wx3.0.2]Getting network path of directory

Postby doublemax » Thu Jun 14, 2018 9:40 am

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
Use the source, Luke!

Rudra
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Fri Sep 13, 2013 2:59 pm

Re: [wxMSW][wx3.0.2]Getting network path of directory

Postby Rudra » Wed Jun 20, 2018 6:42 am

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

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2787
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [wxMSW][wx3.0.2]Getting network path of directory

Postby ONEEYEMAN » Wed Jun 20, 2018 2:43 pm

Hi,
What are you using to access that path? wxDirPicker? wxFileDialog? Or you are trying the hardcoded way?

Thank you.

Rudra
I live to help wx-kind
I live to help wx-kind
Posts: 191
Joined: Fri Sep 13, 2013 2:59 pm

Re: [wxMSW][wx3.0.2]Getting network path of directory

Postby Rudra » Fri Jul 06, 2018 8:04 am

ONEEYEMAN wrote:What are you using to access that path? wxDirPicker? wxFileDialog? Or you are trying the hardcoded way?


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.

Thank you
R.

User avatar
doublemax
Moderator
Moderator
Posts: 12822
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: [wxMSW][wx3.0.2]Getting network path of directory

Postby doublemax » Fri Jul 06, 2018 9:19 am

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".
Use the source, Luke!


Return to “Platform Related Issues”

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests