LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FileSelectPopup - Error at cancel

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

0 Kudos
Message 1 of 5
(3,878 Views)

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.

Message Edited by Roberto Bozzolo on 04-29-2009 05:59 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,873 Views)

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 

0 Kudos
Message 3 of 5
(3,868 Views)

@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

0 Kudos
Message 4 of 5
(3,831 Views)
To test if there is something wrong in your CVI installation, you could try executing some of the samples distributed with the product. There should be a popups.prj sample within samples\userint directory thet makes use of a FileSelectPopup: are you able to run it without errors?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(3,828 Views)