Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update the Tree Control List

Status
Not open for further replies.

MindCracker

Programmer
Aug 27, 2002
21
0
0
GB
Hi,

I have been trying hard to add an imported item into the tree control. This is how I did:

void CTestView::Onimport()
{
String strQuery;
char bstr[300];
CDialogImporter odbc(NULL);
odbc.DoModal();
strQuery = odbc.tablestring;
strcpy(bstr, strQuery.GetBuffer());

// for sub folders of level 1
tvi.iImage = m_idiText;
tvis.hParent = htiSpcs1;
tvi.pszText = _T(bstr);
memmove(&(tvis.item), &tvi, sizeof(TV_ITEM));
HTREEITEM htiNewSpcs = m_secTree.InsertItem(&tvis);
m_secTree.SetItemData( htiNewSpcs, (SEC_DWORD)8);
}

However, i have a slight problem of the screen update. After the imported item is loaded, I have to minimise and then maximise the tree control dialog before I could see the added item on the tree list. Can anyone please help me on that??

cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top