473,830 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re-entrancy, shortcuts in a TreeView

I'm extending TreeView to build a file/directory chooser like the one in
NTBACKUP.

I've implemented four-state checkboxes; no problem.

And I know how to explore files and directories and populate the tree
(including populating branches on demand, when the user first expands them,
rather than trying to search the entire computer at the beginning).

What I'm stuck on is re-entrancy, or multiple paths to the same location.
E.g., "My Documents" at the root of the tree is also "c:\documen ts and
settings\whatev er\My Documents". Any shortcut can create the same
situation.

In NTBACKUP, you simply see the same nodes in both places, complete with
checkmark status.

How should I approach this? In a TreeView, can the Nodes list of two nodes
be the same?

This also implies that any recursive tree crawling that I do must be
cycle-proof.

Any ideas, deep thinkers out there?

Nov 17 '05 #1
2 1518
mdb
"Michael A. Covington" <lo**@ai.uga.ed u.for.address> wrote in
news:OH******** ******@TK2MSFTN GP14.phx.gbl:
What I'm stuck on is re-entrancy, or multiple paths to the same
location. E.g., "My Documents" at the root of the tree is also
"c:\documen ts and settings\whatev er\My Documents". Any shortcut can
create the same situation.


I'm certianly no expert on what you are asking, but as a second pair of
eyes I have a few questions / thoughts...

1) How are you getting the "My Documents" folder to start with? In other
words, you must either be querying something that returns "My Documents" as
a valid location on disk, or you are simply adding it yourself because you
know it to be there. If then you should be able to query what the "My
Documents" folder location is thru PInvoke to shell32.dll
SHGetSpecialFol derLocation (reference www.pinvoke.net perhaps for
assistance on that.) If you are getting it from some other external call,
then I would think there would be something that is returned telling you
that it is a special folder that you can thus handle in a special fashion
(perhaps as already described.)

2) To handle the multiple paths issue, you could use the physical path
location (which will be unique - MyDocuments = C:\Documents and Settings
\user\...) as a key in a hashtable that holds parameters about that
selection (select entire tree, select subtree, etc.)

3) I'm surprised you suggest that a shortcut would cause a similar
condition - shortcuts are just files that contain information about the
target. I would think you would see the shortcut filename instead of the
contents. If this is not the case then you need to find some way to get
the actual shortcut filename, since that is what you really want to access.

Hope this helps a little...

--
-mdb
Nov 17 '05 #2
>> What I'm stuck on is re-entrancy, or multiple paths to the same
location. E.g., "My Documents" at the root of the tree is also
"c:\documen ts and settings\whatev er\My Documents". Any shortcut can
create the same situation.
I'm certianly no expert on what you are asking, but as a second pair of
eyes I have a few questions / thoughts...

1) How are you getting the "My Documents" folder to start with? In other
words, you must either be querying something that returns "My Documents"
as
a valid location on disk, or you are simply adding it yourself because you
know it to be there. If then you should be able to query what the "My
Documents" folder location is thru PInvoke to shell32.dll
SHGetSpecialFol derLocation (reference www.pinvoke.net perhaps for
assistance on that.)


Right; I know how to find out where it is. Have you seen how it's handled
by the file chooser in NTBACKUP?

2) To handle the multiple paths issue, you could use the physical path
location (which will be unique - MyDocuments = C:\Documents and Settings
\user\...) as a key in a hashtable that holds parameters about that
selection (select entire tree, select subtree, etc.)
That smacks of reimplementing entirely too much of TreeView, which is why I
was looking for a shortcut (pardon the pun).

3) I'm surprised you suggest that a shortcut would cause a similar
condition - shortcuts are just files that contain information about the
target. I would think you would see the shortcut filename instead of the
contents. If this is not the case then you need to find some way to get
the actual shortcut filename, since that is what you really want to
access.


Doesn't NTBACKUP follow them and expand them?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4326
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would be better to promote better programming than rely on PHP to compensate for lazy programming?
4
6433
by: Craig Bailey | last post by:
Anyone recommend a good script editor for Mac OS X? Just finished a 4-day PHP class in front of a Windows machine, and liked the editor we used. Don't recall the name, but it gave line numbers as well as some color coding, etc. Having trouble finding the same in an editor that'll run on OS X. -- Floydian Slip(tm) - "Broadcasting from the dark side of the moon"
1
4102
by: Chris | last post by:
Sorry to post so much code all at once but I'm banging my head against the wall trying to get this to work! Does anyone have any idea where I'm going wrong? Thanks in advance and sorry again for adding so much code... <TABLE border="1" bordercolor="#000000" cellspacing="0"> <TR>
11
4016
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
4
18547
by: Alan Walkington | last post by:
Folks: How can I get an /exec'ed/ process to run in the background on an XP box? I have a monitor-like process which I am starting as 'exec("something.exe");' and, of course the exec function blocks until something.exe terminates. Just what I /don't/ want. (Wouldn't an & be nice here! Sigh) I need something.exe to disconnect and run in the background while I
1
3706
by: John Ryan | last post by:
What PHP code would I use to check if submitted sites to my directory actually exist?? I want to use something that can return the server code to me, ie HTTP 300 OK, or whatever. Can I do this with sockets??
10
4231
by: James | last post by:
What is the best method for creating a Web Page that uses both PHP and HTML ? <HTML> BLA BLA BLA BLA BLA
8
4421
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an image, which will upload the record to a mySql db so users can then either view all profiles or query.. I.e. show all males in UK, all femails over 35 etc. Now, I'm not asking for How to do this but more what would be the best way? I've looked at...
1
3642
by: joost | last post by:
Hello, I'm kind of new to mySQL but more used to Sybase/PHP What is illegal about this query or can i not use combined query's in mySQL? DELETE FROM manufacturers WHERE manufacturers_id NOT IN ( SELECT manufacturers_id FROM products )
3
3494
by: presspley | last post by:
I have bought the book on advanced dreamweaver and PHP recently. I have installed MySQL and PHP server but am getting an error on the $GET statement show below. It says there is a problem with the variable $GET but $GET is not a variable, I thought it came from the page that calls the PHP file? if(($_GET)==""){ this gets an error
0
9786
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10769
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10479
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6948
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5778
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3956
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3073
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.