From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

file browser shortcut

Hello,

  I am using LabWindows CVI v12.0 with Windows 7.  I am using the file browser feature and want to be able to click on a shortcut to another folder, but the shortcut does not appear.  Is there a way to use shortcuts with the file browser?  

 

thanks,

Brent

 

0 Kudos
Message 1 of 2
(4,073 Views)

Hello there!

 

Unfortunately, the File Browser Intrument won't display shortcut links in the left folder tree. These are however listed and available in the right tree, where the directory contents are displayed.

 

The reason for this is that, internally, the File Browser Instrument explictly doesn't allow shortcuts to be listed in the right tree, due to the way in which the intrument is written.

However, you are free to change the behavior of the custom control. The source code is located under <CVI Installation>\toolslib\custctrl\FileBrowser.c, so you can modify it to fit your needs.

 

Here is a helpful hint about how you could modify this custom control:

  1. PopulateFolderWithPath populates the right directory tree with all directories under the current expanded item.
  2. The folders from that directory are retrieved using GetFirstFile and GetNextFile.
  3. However, GetFileAttrs filters the items under the directory. As GetFirstFile returns -1 when the .lnk is found, it doesn't add it to the right directory tree and gets skipped.

Here are some options about how you could work around this limitation:

  1. Explicitly verify for .lnk files. This way you can determine that the file/folder is actually a link, without using GetFileAttrs.
  2. Although it's easier to determine symbolic links on Linux (readlink, stat), on Windows, this is a suggestion from MSDN on how to do this: Determining Whether a Directory Is a Mounted Folder

I hope this helps!

- Johannes

0 Kudos
Message 2 of 2
(4,056 Views)