N
Neha8989
Guest
CTreeView::GetItemData() fails when compiled using x64 on windows 10 18003 version.
It works fine with x86 compilation. Even on 1809 version on windows 10, it is working smoothly on X64.
Here is a sample code:
CTreeView *treeView = new CTreeView;
if (!treeView->Create(NULL,
NULL,
WS_CHILD | WS_VISIBLE,
CRect(0, 0, 0, 0), this,11))
{
//TRACE0(_T("Failed to create Tree pane window\n"));
}
TVINSERTSTRUCT tvInsert;
tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("United States");
HTREEITEM hCountry = treeView->GetTreeCtrl().InsertItem(&tvInsert);
CString* str = new CString();
CString *str1 = new CString();
*str = L"Hi";
CTreeCtrl &SourcetreeCtrl = treeView->GetTreeCtrl();
SourcetreeCtrl.SetItemData(hCountry, (DWORD)str);
CTreeCtrl &DesttreeCtrl = treeView->GetTreeCtrl();
CString strText = DesttreeCtrl.GetItemText(hCountry);
str1 = (CString*)DesttreeCtrl.GetItemData(hCountry);
AfxMessageBox(*str1);
Continue reading...
It works fine with x86 compilation. Even on 1809 version on windows 10, it is working smoothly on X64.
Here is a sample code:
CTreeView *treeView = new CTreeView;
if (!treeView->Create(NULL,
NULL,
WS_CHILD | WS_VISIBLE,
CRect(0, 0, 0, 0), this,11))
{
//TRACE0(_T("Failed to create Tree pane window\n"));
}
TVINSERTSTRUCT tvInsert;
tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("United States");
HTREEITEM hCountry = treeView->GetTreeCtrl().InsertItem(&tvInsert);
CString* str = new CString();
CString *str1 = new CString();
*str = L"Hi";
CTreeCtrl &SourcetreeCtrl = treeView->GetTreeCtrl();
SourcetreeCtrl.SetItemData(hCountry, (DWORD)str);
CTreeCtrl &DesttreeCtrl = treeView->GetTreeCtrl();
CString strText = DesttreeCtrl.GetItemText(hCountry);
str1 = (CString*)DesttreeCtrl.GetItemData(hCountry);
AfxMessageBox(*str1);
Continue reading...