07-22-2011 02:33 AM - edited 07-22-2011 02:33 AM
Hi,
We at KPIT Cummins are using LabWindows for one of our automotive projects. We have a GUI with multiple tabs and one of our string text boxes is popping up the below error (also attached jpeg).
FATAL RUN-TIME ERROR: "Temp.c", line 2642, col 38, thread id 0x00000F4C: Invalid argument type: found 'pointer to char', expected 'int'.
We have tried to debug this project and we believe that the line giving us an issue is:
ret_val=SetCtrlVal( h_Tab_Intgd[INTGD_CFG_DATA_TAB], INTGDTAB_ACCXSCALE, aa_uc_Temp_Array );
where,
h_Tab_Intgd[INTGD_CFG_DATA_TAB] is an array of handles for the form (stores all handles for the tabs)
INTGDTAB_ACCXSCALE is the name of the string object (exact constant name as it appears in the LabWindows created .h file for GUI constants)
and aa_uc_Temp_Array is an array of characters. (currently holding "0.000000\n")
There is another form in our code that has a similar feature but with a different constant ID...and the SetCtrlVal seems to work for that form. We do not understand why it gives a runtime error for this particular form.
This project code is a big chunk of code and we cannot currently share the project due to a confidentiality clause. Can you help us find the exact problem with what little information we have shared ?
Solved! Go to Solution.
07-22-2011 02:42 AM
This is an error that I happen to face sometimes, especially with tab controls; in my experience every time I have eventually found that the panel handle was wrong: may it be that your handle arrays ir rewritten somewere so that it holds incorrect values?
If I were you I'd place a breakpoint where you retrieve the panel handle for the tab page and another on faulting SetCtrlVal line, comparing the panel handles in both places.
07-22-2011 05:32 AM
I would like to request a quick confirmation of my understanding of tab page handles...we have defined an array that indices the tab panes from 0,1,2,...n and all our tab pages are indexed using that very zero based index...hope ive done that right !
07-22-2011 06:05 AM
Hello mowgli,
I don't know if I got you right but in my understanding you should not assume tab panel indices but retrieve them using GetPanelHandleFromTabPage.
07-22-2011 07:28 AM
Combining both mowgli and Wolfgang, the correct procedure should be:
int i, numPages, handle[...]; GetNumTabPages (panelHandle, PANEL_TAB, &numPages); for (i = 0; i < numPages; i++) { GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, i, &handle[i]); }
07-25-2011 02:10 AM
Thanks for the code snippet...the error was in the tab page handles...we are grateful for your assistance.