LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Open file GUI access

There is an Open file GUI that CVI uses and that visual c++ lets the programmer use to select and load files from
a dialog box. I would like to know if there is a way to call the popup Open file dialog box to have the user pick a file to load?
The attachment should show what I want. Otherwise is there an example on using the tree GUI to do this. I really do not
want to write one from scatch.
0 Kudos
Message 1 of 2
(2,968 Views)

Hello,

the FileSelectPopup function is what you are looking for.

// Show the File Selection Popup window.
SetBreakOnLibraryErrors (OFF);
file_select = FileSelectPopup ("", "*.*", "", "Please select file", VAL_SELECT_BUTTON, 0, 0, 1, 0, pathname);
SetBreakOnLibraryErrors (ON);
ProcessDrawEvents ();  // Redraw the User Interface after the popup window is gone.

// Check if an error occured while selecting the file.
if (file_select < 0){
 MessagePopup ("Error while selecting file.", GetUILErrorString (file_select));
 return 0;
}

// Check if user clicked the cancel button.
if (file_select = VAL_NO_FILE_SELECTED) return 0;

// ...

0 Kudos
Message 2 of 2
(2,964 Views)