Click here to Skip to main content
14,639,649 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,

I have a case here where I want to open a dialog which will allow to choose file from local drive or mapped network drive.

It's running okay in debug mode. But when I release the software (Installshield), the network drive is not showing in open dialog.

lEr =  RegOpenKeyExW(hKeyUser, L"Network", 0, KEY_READ|KEY_ALL_ACCESS, &hKeyNet);


This line show failed. Returned 2. but running in debug mode is ok.
so Im ensure that the key is there.

Any clue?

Thanks

What I have tried:

I have tried by creating a key "EnableLinkedConnections" with a value of 1. But then the mapped network drive is still not showing from my installed application.
Posted
Updated 4-Jul-19 22:21pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

It may be valid on your system but may not be on others'. I have just checked my machine and the key is there but does not contain anything. You should not use the registry in this way as registry entries are not guaranteed.

You should let the user navigate to the correct place from the dialog.
   
Comments
Member 13627097 7-Jul-19 21:52pm
   
I have a few mapped network drive (example: X:, Y:, Z:).
But then when I Click Open button from my application.
The open dialog does not show all those network drive but only local drive. (C:)

I did tried run in debug mode and all mapped drive are showing. But when I release the software (build using Installshield), the network drive are disappear from open dialog.

Tried with EnableLinkedConnections and also off the user account, but not working.

any solution would help on this issue?
Appreciate Thanks.
Richard MacCutchan 8-Jul-19 2:32am
   
The dialog should show all drives that are mapped in the user's file system. I do not have any network drives on my system so cannot test it here. Maybe if you showed us some code we may be able to spot something, but it is difficult to be certain as the problem may be unique to your system.
Member 13627097 9-Jul-19 22:22pm
   
i do the log file and here is the line show the error.

lEr = RegOpenKeyExW(hKeyUser, L"Network", 0, KEY_READ|KEY_ALL_ACCESS, &hKeyNet);

returned value 2 which is file path not found. But I'm pretty sure the key is there. as running in debug mode is all ok.
Richard MacCutchan 10-Jul-19 15:07pm
   
Use regedit to check the presence of the key. However, as already explained, you should not use this. The user can easily navigate to any attached network drives from the dialog.
Member 13627097 10-Jul-19 22:46pm
   
have already check the key from regedit.

Any other method for this.?

I want something like when we click on Open the dialog, all the drive (local and network drive) to be show for user to select.
Richard MacCutchan 11-Jul-19 3:58am
   
What do you mean? The open file dialog shows the files in the directory where the search starts. The user can navigate to any other directory or drive as he/she chooses. The dialog itself does not control this.
Member 13627097 11-Jul-19 4:52am
   
I have a few mapped network drive. and from the file explore, i able to see and access to those mapped drive.

But When i open a dialog from my application, those mapped drive does not show in the dialog where I'm not able to click on it.
Richard MacCutchan 11-Jul-19 5:01am
   
Sorry, but it is impossible to guess what your code may be doing. Check all the options on the open dialog class in case you have prevented it from looking at network drives.
Member 13627097 13-Nov-19 2:58am
   
any other solution from you?

Do you mean do not use this link for checking?
Richard MacCutchan 13-Nov-19 4:15am
   
Solution to what? We still have no idea what your code is doing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100