Click here to Skip to main content
15,891,657 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: Microsoft foundation class Pin
Richard MacCutchan18-Feb-15 5:32
mveRichard MacCutchan18-Feb-15 5:32 
QuestionI want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan17-Feb-15 14:09
Shibu Krishnan17-Feb-15 14:09 
AnswerRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Richard MacCutchan17-Feb-15 22:42
mveRichard MacCutchan17-Feb-15 22:42 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan19-Feb-15 14:09
Shibu Krishnan19-Feb-15 14:09 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Richard MacCutchan19-Feb-15 21:12
mveRichard MacCutchan19-Feb-15 21:12 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan21-Feb-15 2:22
Shibu Krishnan21-Feb-15 2:22 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Richard MacCutchan21-Feb-15 2:51
mveRichard MacCutchan21-Feb-15 2:51 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan22-Feb-15 7:04
Shibu Krishnan22-Feb-15 7:04 
Sorry to post you incomplete question. I mean the address of the variable I am passing in the lParam.
But again in my GetDataItem() method, i have to typecast to the corresponding variable. is it?
for eg.
CSS
typedef struct address
{
    CString houseName;
    CString placeName;
    int  cnrtyCode;
    char pinCode[6];
};

typedef struct node
{
    CString Name;
    int     Age;
    float   Height;
    address adrs;
};


this is my structure. and
HTREEITEM hItems, hRoot;
	TVINSERTSTRUCT tvInsert;


	pNode->Name = "Shibu";
	pNode->adrs.cnrtyCode = 91;
	pNode->adrs.houseName = "House No 23";
	pNode->adrs.placeName = "Bnglr";
	pNode->Height = 5.5;	
	pNode->Age = 28;

	hRoot	 = m_tree.InsertItem(_T("Personal Data"), 0, 1);
	tvInsert.hParent = hRoot;
	tvInsert.hInsertAfter = NULL;
	tvInsert.item.mask = TVIF_TEXT | TVIF_PARAM;	
	tvInsert.item.pszText = "Name";
	hItems = m_tree.InsertItem(&tvInsert);	
	m_tree.SetItemData(hItems, DWORD(&pNode->Name)); 
.......
.....
        tvInsert.item.pszText = "Age";
	hItems = m_tree.InsertItem(&tvInsert);	
	m_tree.SetItemData(hItems, DWORD(&pNode->Age));


Now my requirement is when i select the treeitem, associated value has to be displayed in a label. Also i have to change the value (through text box entry ; one text box only) of the selected item. Each value ( name,age etc.) are of different data types.

first i tried by passing address of pNode. then how to check my selection (whether user selected name/age/..).

Please help me with a code portion.
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Richard MacCutchan22-Feb-15 7:17
mveRichard MacCutchan22-Feb-15 7:17 
QuestionRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan22-Feb-15 7:36
Shibu Krishnan22-Feb-15 7:36 
AnswerRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Richard MacCutchan22-Feb-15 7:48
mveRichard MacCutchan22-Feb-15 7:48 
GeneralRe: I want to create a treeview with my structure/class variable as nodes and update the same with custom values Pin
Shibu Krishnan22-Feb-15 8:01
Shibu Krishnan22-Feb-15 8:01 
QuestionConst VS Defines Pin
chaq68616-Feb-15 15:00
professionalchaq68616-Feb-15 15:00 
GeneralRe: Const VS Defines Pin
PIEBALDconsult16-Feb-15 16:26
mvePIEBALDconsult16-Feb-15 16:26 
GeneralRe: Const VS Defines Pin
chaq68616-Feb-15 17:46
professionalchaq68616-Feb-15 17:46 
GeneralRe: Const VS Defines Pin
Peter_in_278016-Feb-15 18:52
professionalPeter_in_278016-Feb-15 18:52 
AnswerRe: Const VS Defines Pin
Freak3016-Feb-15 21:43
Freak3016-Feb-15 21:43 
QuestionMessage Closed Pin
16-Feb-15 22:10
mveCPallini16-Feb-15 22:10 
AnswerMessage Closed Pin
16-Feb-15 22:52
professionalOrjan Westin16-Feb-15 22:52 
AnswerRe: Const VS Defines Pin
Orjan Westin16-Feb-15 23:02
professionalOrjan Westin16-Feb-15 23:02 
GeneralRe: Const VS Defines Pin
SoMad17-Feb-15 5:13
professionalSoMad17-Feb-15 5:13 
GeneralRe: Const VS Defines Pin
Albert Holguin17-Feb-15 10:40
professionalAlbert Holguin17-Feb-15 10:40 
GeneralRe: Const VS Defines Pin
Orjan Westin17-Feb-15 23:38
professionalOrjan Westin17-Feb-15 23:38 
AnswerRe: Const VS Defines Pin
Albert Holguin17-Feb-15 10:42
professionalAlbert Holguin17-Feb-15 10:42 
GeneralRe: Const VS Defines Pin
Daniel Pfeffer18-Feb-15 6:13
professionalDaniel Pfeffer18-Feb-15 6:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.