如何动态创建CTreeCtrl并正确显示(在CView里面),谢谢!
CRect Rect(100,100,500,500);
GetClientRect(&Rect);
DWORD dwStyle = GetWindowLong(ctrTree.m_hWnd,GWL_STYLE);
dwStyle |= TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT;
SetWindowLong(ctrTree.m_hWnd,GWL_STYLE,dwStyle);
ctrTree.Create(dwStyle,Rect,this,IDC_TREE);
m_hRoot->hParent = TVI_ROOT;
m_hRoot = ctrTree.InsertItem("我的电脑",0,0);
// m_hRoot = ctrTree.InsertItem("我dfdf",0,0);
// m_hRoot = ctrTree.InsertItem("eee",0,0);
ctrTree.Expand(m_hRoot,TVE_EXPAND);
ctrTree.ShowWindow(IDC_TREE);
这样写好像不对,就是显示不出来结果,请各位指点一下,谢谢!