?
Solved

Combobox populated with directory tree.

Posted on 2006-03-24
6
Medium Priority
?
263 Views
Last Modified: 2008-02-26
I’m currently working on an application that has a combobox that is populated manually to display the file structure of the local system. It basically resembles an explorer style drop down. The problem is since this is a manually populated listing we load each special folder using SHGetSpecialFolderPath() to get the specific folders we need. In the end we always populate the outline below:

Desktop
My Computer
<drive C:>
<drive D:>
<mapped drive Q:>
Shared Documents
My Documents
My Pictures

After we hash out these files we have another function that loops through and finds the folder or drive that matches the current folder selected on the combobox then we will in the subfolders below the selected folder:

Example: system folder is selected from C:\Windows\System32

Desktop
My Computer
<drive C:>
      Windows
            System32
<drive D:>
<mapped drive Q:>
Shared Documents
My Documents
My Pictures

The problem is we’ve run into a situation where mapping unmapped drives is causing sporadic results as we’re manually creating these directories by hand and adding them into the combobox.

Is there a way that we can tie something similar to the browsing capability of LPITEMIDLIST into a combobox? Every available suggestion has been to bring up a dialog box for the user to select but we have one available and wish to incorporate the same functionality into a combobox. If anyone can please advise me on how to go about doing this or any suggestions? Seems to me there should be an easy way to create a combobox that maps to all the available system folders and networked drives but I can’t seem to find anything. Help is very much appreciated!.
0
Comment
Question by:RampidByter
  • 3
  • 3
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 750 total points
ID: 16284313
0
 
LVL 86

Expert Comment

by:jkr
ID: 16286526
Oh, and if you should use MFC, 'CWnd' has teh corresponding member functions.
0
 

Author Comment

by:RampidByter
ID: 16303712
After taking a look at what you provided it is sort of what I’m looking for but not exactly. Currently when you click on my combo box is displays the same style of information as you would with a pidl while browsing for a file but does not support unmapped drives. The combo dialog options were extremely limited as far as what I found. You must specify a path that is only fills the subdirectories for that particular path. The way the combo box needs to be is it gets a path and shows the sub directories for that path in relationship to the already existing directory structure I mentioned previously. Is there any alternative ways to displaying an explorer style listing of the

What im going for is something similar to setting up BROWSEINFO with the information populated from the SHGetSpecialFolderLocat().

SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOP, &pidlRoot);

Any suggestions?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 86

Expert Comment

by:jkr
ID: 16303973
That should work if you you use 'ShGetSpecialFolderPath(...,CSIDL_DESKTOP,...)' to obtain the 'lpPathSpec'
0
 

Author Comment

by:RampidByter
ID: 16306332
Could you show me a snippet of what this would look like in relationship to the combo box control? If you're correct then I think you've answered my questions!
0
 

Author Comment

by:RampidByter
ID: 16307457
I was looking into it though and if i use a virtual path, which is what I need to do that it will fail when calling that function.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question