04-29-2009 10:07 AM
hello,
I have a little problem with the fileselectpopup
I select a popup with the function
FileSelectPopup( "c:\\Documents\\Axinia\\LabWindows-CVI\\Files","*.ini", "*.ini", "Select File", VAL_LOAD_BUTTON , 0, 0, 1, 0, buffer );
if I now, press cancel comes following error:
NON-FATAL RUN-TIME ERROR: "function.c", line 302, col 9, thread id 0x00000D2C: Library function error (return value == -55 [0xffffffc9]). The index passed is out of range
can everybode told me how I prevent this?
thanks
04-29-2009 10:58 AM - edited 04-29-2009 10:59 AM
This is strange: I never have seen this error on FileSelectPopup. Can you experiment with different buttons (for example Select or Open button)?
Are you sure this error happens in that exact line? Column 9 is in the middle of the command name, it's not likely to refere to FileSelectPopup command. Could it be that you are not handling the VAL_NO_FILE_SELECTED return code and are trying to process a (possibly) empty 'buffer' variable? Executing the code step-by-step can be a useful mean of detecting where exactly the error arisea and what your code is doing: place a breakpoint on FileSelectPopup line and execute one instruction at a time by pressing F8 key.
04-29-2009 11:13 AM
Axinia,
How large is your "buffer". It looks to me as though you haven't allocated a buffer large enough to hold the filename. Your char buffer should be MAX_PATHNAME_LEN (1024) bytes.
Greg
04-30-2009 08:56 AM
@Roberto Bozzolo
I has already tried with different buttons. if I, for example, load it also clicks functioned. it does not function only if I cancel press.
yesterday I have already obeyed your advice already before I posted this problem. the buffer is filled correctly. and error is indicated in exactly this line at this point
@gavan
the buffer has in length of 1024 this I have also already tried
04-30-2009 09:14 AM