03-15-2011 11:55 AM
I actually had this function in my program for years and it's been working fine. I create a default file name as a string variable, "filename.ext", no path. I recently updated to CVI 2010 but I also did some work in another module and then cleaned up this and several other modules before re-compiling. I noticed that when I then went to use the program, the default file name does not appear in the pop-up.
Solved! Go to Solution.
03-16-2011 03:58 PM - edited 03-16-2011 03:59 PM
Hello,
It's possible that when you were editing your code, something was changed in your FileSelectPopup function call. I would check your source code for a change in the Default Directory value, which is also the first parameter that is sent to the FileSelectPopup function. If the first parameter in the FileSelectPopup function call of your source code (file ending in .c) is " ", then simply replace that parameter with "filename.ext".
Let me know how that goes!
03-16-2011 05:02 PM
Shawn:
I'm seeing the same thing that JoeKenZ saw: after I updated to CVI 2010, the default file spec in the dialog box went away. The default file spec is the second parameter to FileSelectPopup. Here's the help for that parameter: The defaultFileSpec appears in the filename box when you initially display the pop-up. If you specify an actual filename, such as test.c, that name appears in the filename box and also in the file list box.
I created a simple test file. I tested it with CVI 9.0.1, prior to installing CVI 2010, and the filename appeared. Then I installed CVI 2009, and the name was still there. Then I installed CVI 2010 (from your link for SSP members here: http://digital.ni.com/src.nsf/websearch/328E657FA0DB8911862577EC005B9ACC?OpenDocument&node=node=2030...), and now the filename is blank. I did not edit any code. I just recompiled the file and ran it. Now, since I have the 2010 runtime, the filename is blank regardless of which version I run.
Here's the code I ran.
#include <userint.h>
main()
{
char myPath[260];
FileSelectPopup ("", "readme.txt", "", "", VAL_LOAD_BUTTON, 0, 0, 1, 0, myPath);
}
03-16-2011 10:25 PM
No, I have actually copied a previous version of that module into the program and the default file name was still not there. I've also got a couple different functions that call FileSelectPopup and the default file name doesn't come up in either.
03-16-2011 10:27 PM
Thanks, that will save me some time chasing my tail.
@Al S wrote:
Shawn:
I'm seeing the same thing that JoeKenZ saw: after I updated to CVI 2010, the default file spec in the dialog box went away. The default file spec is the second parameter to FileSelectPopup. Here's the help for that parameter: The defaultFileSpec appears in the filename box when you initially display the pop-up. If you specify an actual filename, such as test.c, that name appears in the filename box and also in the file list box.
I created a simple test file. I tested it with CVI 9.0.1, prior to installing CVI 2010, and the filename appeared. Then I installed CVI 2009, and the name was still there. Then I installed CVI 2010 (from your link for SSP members here: http://digital.ni.com/src.nsf/websearch/328E657FA0DB8911862577EC005B9ACC?OpenDocument&node=node=2030...), and now the filename is blank. I did not edit any code. I just recompiled the file and ran it. Now, since I have the 2010 runtime, the filename is blank regardless of which version I run.
Here's the code I ran.
#include <userint.h>
main()
{
char myPath[260];
FileSelectPopup ("", "readme.txt", "", "", VAL_LOAD_BUTTON, 0, 0, 1, 0, myPath);
}
03-17-2011 08:43 AM
Hey guys -
This is actually a known issue in LabWindows/CVI 2010, and will be fixed in the next service pack.
Sorry for any inconvenience -
NickB
National Instruments
03-17-2011 09:34 AM
Is there a target date set for the next service pack? This is a rather inconvenient bug. With everyone typing in their own file names, I'm going to end up with inconsistent and miss-matching data file names.
03-17-2011 11:05 AM
The next service pack is scheduled to be released in about 3 months. Is this too long for you to wait?
NickB
National Instruments
03-17-2011 11:30 AM - edited 03-17-2011 11:31 AM
JoeKenZ:
It sounds like you want to select the filename for the user, but give the user the option to change something (otherwise why would you use FileSelectPopup?). If you want them to use your filename, but allow them to choose a directory, why not use DirSelectPopup() instead?
Or if you want them to usually use your default, but give an option to change the filename or directory, you could display a dialog box showing the default and asking the user if they want to accept the default or use a different filename or directory, and only call FileSelectPopup if they don't like the default.
03-17-2011 12:20 PM
That pretty much hits the nail on the head. I not only have data files but I have files that save the configuration of all the instruments attached to the system, files that track and save any changes to instrument settings and a file that just collects operator notes. I'll limit the operator's choices for a while. I've already started changing some of the code to use just DirSelectPopup before lunch.
Thanks