LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FileSelectPopup not recognizing the default file spec parameter

Solved!
Go to solution

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.

0 Kudos
Message 1 of 27
(4,935 Views)

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!

 

 

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
0 Kudos
Message 2 of 27
(4,900 Views)

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);
 
}

Message 3 of 27
(4,890 Views)

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.

0 Kudos
Message 4 of 27
(4,878 Views)

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);
 
}


 

0 Kudos
Message 5 of 27
(4,873 Views)

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

0 Kudos
Message 6 of 27
(4,846 Views)

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.

0 Kudos
Message 7 of 27
(4,835 Views)

The next service pack is scheduled to be released in about 3 months.  Is this too long for you to wait?

 

NickB

National Instruments

0 Kudos
Message 8 of 27
(4,824 Views)

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.

0 Kudos
Message 9 of 27
(4,815 Views)

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

0 Kudos
Message 10 of 27
(4,809 Views)