July 20th, 1998, 11:42 AM
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.com survey!