This is really wierd!
I found this at msdn:
Code:
typedef struct tagTVITEM {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TVITEM, *LPTVITEM;
So I tried this:
Code:
LPTSTR cName = "Testing... 1..2..3...";
tvi.pszText=cName; //item label
tvi.cchTextMax=lstrlen(tvi.pszText); //length of item label
tvis.item=tvi;
tvis.hParent=hPrev; //parent item of item about to be inserted
hPrev=(HTREEITEM)SendMessage(g_hwndTreeView,TVM_IN SERTITEM,0,(LPARAM)&tvis);
And it didn't work.
But I see no reason why. My var is the exact same type as the one I am assigning it to.