MindCracker
Programmer
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,
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,