Tree Control Help needed

How do I add files to a tree control. I have all the directory and sub directorys ..need the files to

heres the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CFileFind fd ;

if ( path.Right ( 1 ) != "\\" )

path += "\\" ;

path += "*.*" ;

BOOL found ;

found = fd.FindFile ( path ) ;

if ( !found )

return ;

HTREEITEM childhitem ;

while ( found )

{

found = fd.FindNextFile( ) ;

if ( fd.IsDots( ) )

continue ;

if ( fd.IsDirectory( ) )

{

childhitem = m_tree.InsertItem ( fd.GetFileName( ), 1, 1, hitem ) ;

m_tree.InsertItem ( "", 0, 0, childhitem ) ;

}

}
anyone ?
Topic archived. No new replies allowed.