06-20-2011 06:32 AM
Hi,
I have this error response when I run the function "InsertListItem" in my CVI application.
The problem is that this function run until two weeks ago, when I have done a total backup of the project. From yesterday I found this error and I can't go on. Any field of the function is the same of the previous time, so I don't know what to do now...
Anyone knows which are the possibile reasons?
Thank you
B.M.
06-20-2011 08:44 AM
There is no definitive answer to your question: without looking at the code is difficult to understand what may have happened.
May it be that the list control is on a tab control and the order of tab pages has been changed? If so, an hypothetical GetPanelHandleFromTabPage could return an incorrect handle if you have not updated the page index accordingly. Hence the error you are getting. I would expect, if this is the case, some other simila error in this case, though, unless the list control is the only one present on that page.
But this is only a blind shot (and I haven't serviced my crystal ball recently ).
06-20-2011 11:30 AM - edited 06-20-2011 11:31 AM
Ok sorry, you're right...
My code is the following, I didn't report it because I didn't think it may be useful...
...
if ( (strcmp(name, "flow")) && (strcmp(name, "address")) )
{
InsertListItem (tiger, PANEL_INLISTBOX, j, name, 0);
j++;
}
...
The parameters are:
- tiger --> static int generated by the followinf command: "tiger = LoadPanel (0, "GraphIF.uir", PANEL);
- PANEL_INLISTBOX --> get by "GraphIF.uir" and it is defined;
- j --> int initialized to '0';
- name is a simple char[];
- the last field is always 0.
When I run the code in debug way, all the parameters of the function are correct, but with the execution of "InsertListItem" CVI gives back a "Fatal RunTime error". The problem is that this code does not run anymore. I'm afraid that something was corrupted on my PC, but I don't know what.
My function declaration seems to be correct, only the execution does not run (the builder gives me no error).
Do you understand something more now or my explanation was confusing?
Thx
06-20-2011 11:47 AM
I don't know exactly what to think: the code apparently is good, moreover it has worked for a time so I suppose the problem may lie outside the code...
How did you backed up the whole project? Could you have restored some old UIR file version with different panel/control names?
You could try to click on the file name in LoadPanel line and press Ctrl+U, seeing if the correct UIR file is opened; next you can click on PANEL_INLISTBOX and press Ctrl+Shift+U checking that the correct control is found.
Additional questions: are you always running in the IDE (debug mode) or the error comes up in the executable?
Have you checked 'tiger' and 'PANEL_INLISTBOX' values at runtime? Are they correct?
06-22-2011 09:58 AM
Ok, you give me the right idea. The problem was in the ".h" file, where I overwrote a button command constant!!! Once understood, in 5 second no problem is more present
Thanks, now my project runs again
BM
06-22-2011 10:02 AM
Problem solved
black_mamba ha scritto:
Ok, you give me the right idea. The problem was in the ".h" file, where I overwrote a button command constant!!! Once understood, in 5 second no problem is more present
Thanks, now my project runs again
BM
04-23-2014 02:50 AM
Ho avuto proprio ieri lo stesso problema. La vecchia copia di backup dell'UIR funzionava la nuova no.
Dopo vari tentativi ho pensato all'ultima modifica: avevo "INCOLLATO" un nuovo controllo (TIMER in particolare) tolto da un altro pannello.
Rimosso quel controllo .... tutto funziona. Rimesso.... tutto bloccato.
Soluzione: l'ho tolto e lo ho "CREATO" localmente identico. FUNZIONA.
Auguri,
Gianantonio