Finding an item in CTreeCtrlX
Hi All!
The problem:
i've search from the root to the end in the control for an item with the FindItem function. But the function returned always NULL.
Whats wrong?
The solution:
The item was the first and the hItem paramter was GetRootItem(). The Item was never found by the function.
So you should change in the FindItem function:
// change
while( htiCur && htiCur != htiSel ) -> while( htiCur )
and to the end of the brakes you should insert
// original
if( htiCur == NULL )
{
if( bDownDir ) htiCur = GetRootItem();
else htiCur = GetLastItem( NULL );
}
// insert
if ( htiCur == htiSel ) break;
}
}
And then it works
By René