02-28-2012 10:51 AM
Bonjour,
Nous avons reproduit systématiquement une erreur qui plante notre application.
Lorsque la touche "FIN" du clavier est appuyée alors que l'IHM de notre application affiche un onglet géré avec les outils easytab.fp, une fentre d'erreur s'affiche et notre application est fermée :
"Assert!"
"Programming error detected"
"The error was detected on line 507 of file easytab.c"
"Program aborting"
Le problème est que nous n'avons pas le moyen de filtrer ce code par la fonction associée à cette fenetre, le module "easytab.c" intervenant avant.
Merci de nous apporter une aide, voire une solution pour ce problème sévère qui génère une plante d'application brutale.
Salutations,
Franck Dubreuil
IN-CORE Systèmes
02-28-2012 11:11 AM
I am not a french-speaking person, so I'm trying to figure out your situation.
You possibly don't know that the source code for the easytab instrument is distributed along with CVI, so you can go and see in your development PC what's happening in this moment. The code is normally located in the same folder as the .fp file, usually in \program files\national instruments\cvixx\toolslib\custctrl or similar folder, being xx the release number.
Besides it, when addressing a specific error with a line number, it is important to know which is the version you have developed your program on, as the instrument may have had updates and corrections over time.
02-29-2012 02:33 AM
Hello,
I can explain in english if you prefer.
Our software is made with LabWindows/CVI 8.5
An error message appears when the key "END" is pressed on the keyboard when software displays a panel with tabs, managed with easytab control.
The error says "ASSERT!" and the line 507 in the module easytab.c, and after that the software crash.
I have seen the easytab.c file and I have replaced easytab.fp with easytab.c in my project in a way to check the error message at line 507.
So I have seen the line 507 with the command "ASSERT(FALSE)" and then the abort of our software because of this error.
Despite this observation, I don't know what to do now.
Should I try to correct the problem in the source file easytab.c ?
Can you please first check the version of LabWindows/CVI in the case an improvement exists.
Best regards
Franck Dubreuil
02-29-2012 07:43 AM
Hello,
I don't know if you have something wich is different at line 507 in your easytab.c but this is what I have starting from the 502 line :
static void EasyTab_MoveActiveRowToEnd(TabGroup group)
{
Sheet activeSheet;
int row;
ListType oldActiveSheetRowList;
ListType newActiveSheetRowList;
ListType rowLists;
int numRows;
/* move list of sheets on the active row to the end of the list of sheet lists so they will draw on the bottom */
rowLists = EasyTab_GetRowLists(group);
if (rowLists)
{
numRows = ListNumItems(rowLists);
activeSheet = EasyTab_GetActive(group);
if (activeSheet)
{
if (!EasyTab_GetSheetDisplayPosition(group, activeSheet, &row, NULL))
Assert(FALSE);
if (row < numRows)
{
ListRemoveItem(rowLists, &newActiveSheetRowList, row);
ListRemoveItem(rowLists, &oldActiveSheetRowList, END_OF_LIST);
ListInsertItem(rowLists, &newActiveSheetRowList, END_OF_LIST);
ListInsertItem(rowLists, &oldActiveSheetRowList, FRONT_OF_LIST);
}
}
}
}
Is it different from what you have?
PS : I use LabWindows CVI 2010.
Regards
Jérémy C.
NI France
02-29-2012 08:17 AM
Hello,
Yes the same function exactly, and the file "easytab.c" is dated from 7 april 2008 9h00.
The error message come from the line 507 : Assert(FALSE)
It seems the function return FALSE (no row found ?)
Franck
02-29-2012 09:33 AM
Hello again,
It seems that "found" remains false after executing the following function :
static int EasyTab_GetSheetDisplayPosition(TabGroup group, Sheet sheet, int *row, int *column)
{
int numRows;
ListType rowLists, currRowList;
int columnIndex, rowIndex;
int found = FALSE;
rowLists = EasyTab_GetRowLists(group);
if (rowLists)
{
numRows = ListNumItems(rowLists);
for (rowIndex = 1; rowIndex <= numRows; rowIndex++)
{
ListGetItem(rowLists, &currRowList, rowIndex);
columnIndex = ListFindItem (currRowList, &sheet, FRONT_OF_LIST, NULL);
if (columnIndex > 0)
{
found = TRUE;
break;
}
}
}
if (!found)
{
columnIndex = 0;
rowIndex = 0;
}
if (column)
*column = columnIndex;
if (row)
*row = rowIndex;
return found;
}
You could try to use breakpoints to check the elements' values and see why "found" isn't set to true.
Feel free to post your code in order to give us a better overview of what you're working on.
Regards,
Jérémy C.
NI France
03-01-2012 03:18 AM
Hello,
So I have replaced easytab.fp with easytab.c and start again our software to check the issue.
It seems that the function returns FALSE because the last tab (END key normally jumps to the last tab) is currently NOT VISIBLE.
In this software we manage tabs that can be visible or not, depending on options in the software settings.
In the case the last tab is visible, there is not software crash.
I have made a little modification in the esaytab.c not to execute the ASSERT(FALSE) in the case the function returns FALSE, but
the problem is that the unvisible tab becomes visible !
Franck
03-01-2012 04:00 AM - edited 03-01-2012 04:02 AM
You could try an alternative approach; when executing your END function you could:
(possibly iterating on all tabs from the las one backwards until a visible tab is found).
Another alternative is to move from the EasyTab instrument to native tab controls; transition is not so difficult: instead of loading panels and adding them to the easytab you must create the tabs in the UIR editor and then get the corresponding panel handles with GetPanelHandleFromTabPage function after the panel has been loaded. The tab control can take the ID of the canvas you are using for the EasyTab, page constant names can be the same as the names of the panels you are loading into the EasyTab so that existing code will need only very fiew modifications.
I don't know how complex is your application, but I have made this transition for some software of mine and found it is quite simple so I suggest you to consider it.