TAdvExplorerTreeView not working with UNC FolderPath

I have an issue with TAdvExplorerTreeView V1.5.1.0. If i set FolderPath to a local folder, everything is working as expected. If i set FolderPath to a UNC path containing subfolders it is working too.

But if i set FolderPath to an UNC path containing only the server name and a share name, the explorer treeview is not working (no display in the navigation bar and i cannot change directories using SetSelectedFolder).

Examples:

C:\ -> working
C:\SharedFolder -> working
\\Server\ShareName\SubFolder1 -> working
\\Server\ShareName -> not working

Best Regards

Mario Leibezeder
IsoDev GmbH

Thanks for reporting.
We traced & solved this issue. The next update will address this.

Hello again,

I have the same problem again with the latest TMS version 13.2.0.0.

TAdvExplorerTreeview version 1.5.1.1 fixed the problem, but 1.5.1.2 shows the same behavior as 1.5.1.0. UNC root path does not work.

There is also an access violation in the Win64 version.

Best Regards,

Mario Leibezeder
IsoDev GmbH

I retested this here but I could not see an issue with an UNC FolderPath and I could not see an access violation. Do you have exact details for how to reproduce this?
I could also not see code changes that would change the behavior with UNC.

The following example project contains only one TAdvExplorerTreeView and the following line of code in the FormActivate method

AdvExplorerTreeview1->FolderPath = "\\\\localhost\\C\\";

TAdvExplorerTreeview.zip (782.3 KB)

Compiled with RADStudio 12.2 Patch 2 - C++Builder 64bit on Windows 11 Pro Version 23H1 gives the following error:

image

I get the error:
image

You need to:

a) change the folder path to an existing UNC path on your system (it must be a root path with no subdirectories. In my case it was something like “\\servername\sharename\”)

or

b) create a share on your local system C drive.

If the UNC path exists, you won’t get the “Invalid folder path” message and you should see the AccessViolation error.

I think, the path validation happens before the access violation

I cannot reproduce this

advexplorertreeview

I traced the error back to this line of code:

I really need steps to reproduce this as from the code, I can really not see any reason for Owner being nil there. Owner is already set at Nodes creation time.
Can you provide a sample source app + steps with which we can reproduce this?

I think the problem is FindFirst is not working with network share root paths. (see Microsoft FindFirstFile Documentation FindFirstFileA function (fileapi.h) - Win32 apps | Microsoft Learn).

On network shares, you can use an lpFileName in the form of the following: "\\Server\Share\*". However, you cannot use an lpFileName that points to the share itself; for example, "\\Server\Share" is not valid.

FindFist fails on "\\localhost\*.*" with error 67

Changing the search mask to "\\localhost\C\*.*" int the next step works

but then "Node" is never set because fn = "C" is not part of the search result.

In 32bit "Node" is nil but in 64bit it points to invalid memory which leads to the access violation later on.

I reopened this case once again but I cannot make sense of what you write nor can I reproduce a problem.
I set in code AdvExplorerTreeVie.FolderPath to a value '\servername\sharename' and this works as expected. When it finds this construct, it will append '.' to find all files. FindFirst()/FindNext() return correctly all the files on this path. I retested this once more in 32bit and 64bit and see no failure at all.
Again, what exactly do you mean with '\localhost' ? Localhost is not a valid server name here. When I use '\localhost' it simply says "invalid path".
So, what exactly are you doing?

I use "localhost" for testing only. My customer has a folderpath like "\\servername\cad\"

Steps to reproduce:

  1. create a share on your local machine (like "C:\Test\" -> "\\localhost\Test\")

image

  1. Create a new Project and add TAdvExplorerTreeView to the main form.
  2. Add following two lines of code to FormActivate

CBuilder:

AdvExplorerTreeview1->Mode = aeFolder;
AdvExplorerTreeview1->FolderPath = "\\\\localhost\\Test\\";

Delphi:

AdvExplorerTreeview1.Mode := aeFolder;
AdvExplorerTreeview1.FolderPath := '\\localhost\Test\';

In 64bit i get an accessviolation on the second line. In 32bit AdvExplorerTreeView shows no subfolders.
2025-01-13 17-39-17

We applied an improvement that will be included in the next update.