LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding to tree control CVI

Solved!
Go to solution

I am trying to use the GetTreeItemAttribute CVI function and get the check box state information from a tree and store in a array, but the compiler just gives me errors showing 

NON-FATAL RUN-TIME ERROR: "Test.c", line 92, col 17, thread id 8188: Function GetTreeItemAttribute: (return value == -10 [0xfffffff6]). The control is not the type expected by the function。

the source code looks like following:

 

int panelID = 0;  

int i;
int Mark_State;

char Flag[MAXNUMBER];

 

nullChk (InitCVIRTE (0, argv, 0));
errChk (panelID = LoadPanel (0, "test.uir", PANEL));

 

for (i = 0; i < MAXNUMBER; i ++){

       GetTreeItemAttribute (panelID, TABTEST_TREE, i, ATTR_MARK_STATE, &Mark_State);
       Flag[i] = Mark_State;
}

 

If possible, can somebody help me to take a look and see what is wrong with my code?

 

Thank you

0 Kudos
Message 1 of 3
(2,812 Views)
Solution
Accepted by topic author SilverMan

Hi,

You named the tree control as TABTEST_TREE. If your tree is in a tab control you need to get panel handle of the tab. Tab pages have their own panel handles. This is the documentation.

Hope this solves your problem.

S. Eren BALCI
IMESTEK
Message 2 of 3
(2,774 Views)

Thank you so much for the help! i didn't realize that TAB will need a different handler.  The problem is fixed.

0 Kudos
Message 3 of 3
(2,751 Views)