LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InsertTreeItem problem

Hi,
 
I am using InsertTreeItem to create a tree dynamically. Followed are the part code I used:
 
  for(i=0; i<NUM_NESTS; i++)
  {
   sprintf(szBuffer, "%d", i+1);
   InsertTreeItem(plDebugger, plDebugger_rgNest, VAL_SIBLING, 0, VAL_LAST, szBuffer, szBuffer, 0, i);
}
 
and my program crashed with the error
" NON-FATAL RUN-TIME ERROR:   "debugger.c", line 95, col 13, thread id 0x00000E48:   Library function error (return value == -10 [0xfffffff6]). The control is not the type expected by the function"
 
Anyone who knows how to solve it, it would be greatly appreciated. Thanks.
 
Hui


Message Edited by huizhong chen on 12-17-2007 05:35 PM
0 Kudos
Message 1 of 6
(3,989 Views)
Hey Hui,

It looks like the plDebugger_rgNest parameter does not correspond to a tree view control handle.  Ensure that this constant name aligns with what is configured in your uir file.
Thanks,

Andy McRorie
NI R&D
Message 2 of 6
(3,960 Views)

I'm experiencing the same runtime error described here. In my case, the function call looks like:

rootIndex = InsertTreeItem(panelHandle, controlID, VAL_SIBLING, 0, VAL_FIRST, "CCSDS_CADU", NULL, 0, NULL);

panelHandle is the value returned from the call to LoadPanel in the main() function. controlID is the macro that was added to the application header file for this tree control when I saved the .uir file. Is this the value I should be using for controlID?

 

Barry Wealand

 

0 Kudos
Message 3 of 6
(3,364 Views)

In my case, I have the tree control contained within a tab control, and I was passing the main panel handle, rather than the tab panel handle, to InsertTreeItem. When I used the tab panel handle instead, problem solved.

 

Barry Wealand

 

0 Kudos
Message 4 of 6
(3,361 Views)
It looks like the plDebugger_rgNest parameter does not correspond to a tree view control handle.  Ensure that this constant name aligns with what is configured in your uir file. 

Or 'plDebugger' you are using in panel handle parameter is really the panel name. In the first parameter of almost all User Interface library you must pass the panel handle, returned from the system when calling LoadPanel or similar functions. This is because you can have several instances of the same panel active in the system, each identified by the corresponding handle, not the panel name.



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 6
(3,340 Views)

Barry_Wealand ha scritto:

In my case, I have the tree control contained within a tab control, and I was passing the main panel handle, rather than the tab panel handle, to InsertTreeItem. When I used the tab panel handle instead, problem solved.

 

Barry Wealand

 


You are right! Each page of a tab control can be considered as an independent panel, with its proper handle.



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 6 of 6
(3,338 Views)