유수홍
유수홍

Reputation: 3

How can I update CFileView tree in MFC?

I generated a new MFC project which is a MDI with Ribbon bar and explorer docking pane(CFileView class) by Visual Studio 2015.

I make a code which can select the specific files in my harddisk drive by using CFileDialog class and save the file names in a CString vector which located in C*App class.

Main

However, I cannot get how to put this file names into the tree for display after I select the files. At first, I just modified the FillFileView() class in the CFileView class, and no error detected. However, when I execute the code, an error message appears.

Variable declaration & Source code & Error message

Please answer to my question how to fix this.

Upvotes: 0

Views: 325

Answers (1)

ItsTheJourney
ItsTheJourney

Reputation: 23

Since the file Names are in a vector, can you try manually iterating over the vector & populating your Tree control? CTreeCtrl has an InsertItem() method.

Upvotes: 0

Related Questions