需要从CMyApp进入树状视图 [英] Need to get to tree view from CMyApp
本文介绍了需要从CMyApp进入树状视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写MFC资源管理器样式的应用程序.我正在尝试更新左侧的树视图,称为CTreeView.
在CMyApp中,我在
中捕获了一条消息
I am writing an MFC explorer style application. I am trying to update the tree view which on the left, and is called CTreeView.
In CMyApp I have caught a message in
ON_COMMAND(ID_WORKSPACE_OPEN, &CBWE8App::OnWorkspaceOpen)
CMyApp::OnWorkspaceOpen()
{
...
// code to read workspace file contents
}
我希望能够读取文件的内容以更新左树视图,因此我需要从该文件中获取左视图(CLeftView),以便可以执行
I want to be able to read the contents of a file to update the left tree view, so I need to get hold of the left view (CLeftView) from this file so that I can do
CTreeCtrl& Tree = GetTreeCtrl();
//and then aftet some code, I can update the tree-view
HTREEITEM hti1 = Tree.InsertItem(lpszItem1, 0, TVI_LAST);
但是我不知道如何掌握CMyApp的树状视图-请有人帮忙!
But I don''t know how to get hold of the tree view from CMyApp - please could somebody help!
推荐答案
这可能很有趣 ^ ]
最好的问候
Espen Harlinn
This might be of interest Creating a Windows Explorer-Style MFC Application[^]
Best regards
Espen Harlinn
这篇关于需要从CMyApp进入树状视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文