July 20th, 1998, 12:42 PM
Finding an item in CTreeCtrlX
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.
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:
while( htiCur && htiCur != htiSel ) -> while( htiCur )
and to the end of the brakes you should insert
if( htiCur == NULL )
if( bDownDir ) htiCur = GetRootItem();
else htiCur = GetLastItem( NULL );
if ( htiCur == htiSel ) break;
And then it works
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.