Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get the printer's information Pin
blongtq26-Jun-02 17:45
blongtq26-Jun-02 17:45 
Generallistview & Win98 Pin
Maurizio Pisano25-Jun-02 18:13
Maurizio Pisano25-Jun-02 18:13 
GeneralRe: listview & Win98 Pin
Nish Nishant25-Jun-02 19:27
sitebuilderNish Nishant25-Jun-02 19:27 
GeneralRe: listview & Win98 Pin
Maurizio Pisano25-Jun-02 19:43
Maurizio Pisano25-Jun-02 19:43 
GeneralRe: listview & Win98 Pin
Maurizio Pisano26-Jun-02 1:01
Maurizio Pisano26-Jun-02 1:01 
GeneralSetClipboardViewer Pin
adara25-Jun-02 18:07
adara25-Jun-02 18:07 
GeneralRe: SetClipboardViewer Pin
Rage25-Jun-02 22:09
professionalRage25-Jun-02 22:09 
GeneralWin32 Tree Question Pin
NullStream25-Jun-02 17:47
NullStream25-Jun-02 17:47 
It seems that when I add to a TreeControl (Win32 SDK not MFC) the pszString item I add is not the same was what I put in (eg. Put in text and get back a large string of hi-ascii).

I insert into the tree thusly:
<br />
	TVINSERTSTRUCT tvs;<br />
	TVITEM tvi;<br />
	HTREEITEM last;<br />
<br />
	tvs.hInsertAfter = TVI_LAST;<br />
	tvi.mask = TVIF_TEXT;<br />
<br />
	tvi.pszText = "Test Item #1";<br />
	tvs.hParent = TVI_ROOT;<br />
	tvs.item = tvi;<br />
	last = TreeView_InsertItem(GetDlgItem(MainWindow,IDC_TREE),&tvs);<br />


To retrieve I handle the WM_NOTIFY message when the event is TVN_SELCHANGED.
<br />
	case WM_NOTIFY: <br />
		node = (LPNMTREEVIEW)lParam;<br />
		if(node->hdr.code == TVN_SELCHANGED) {<br />
			MessageBox(MainWindow,(char *)node->itemNew.pszText,"Selection CHANGED!",0);<br />
		}<br />
		break;<br />

In the debugger node->itemNew.pszText is high ascii garbage and no where near the "Test #1" item I put in. The book I have and the docs I've found so far all use the TreeControl by comparing the selected item to a list of the items added which is no good for me because I'm trying to build up the entire path from each selected tree item (like a file path). This occurs with multiple items in the tree control as well.

Any suggestions or ideas on where I have gone wrong would be greatly appricated.

Sean
GeneralRe: Win32 Tree Question Pin
Michael Dunn25-Jun-02 17:51
sitebuilderMichael Dunn25-Jun-02 17:51 
GeneralRe: Win32 Tree Question Pin
NullStream25-Jun-02 19:01
NullStream25-Jun-02 19:01 
GeneralRe: Win32 Tree Question Pin
Rage25-Jun-02 22:39
professionalRage25-Jun-02 22:39 
GeneralRe: Win32 Tree Question Pin
Roger Broomfield26-Jun-02 0:52
Roger Broomfield26-Jun-02 0:52 
GeneralRe: Win32 Tree Question Pin
NullStream26-Jun-02 1:24
NullStream26-Jun-02 1:24 
GeneralRe: Win32 Tree Question Pin
Roger Broomfield26-Jun-02 3:25
Roger Broomfield26-Jun-02 3:25 
GeneralRe: Win32 Tree Question Pin
NullStream26-Jun-02 21:45
NullStream26-Jun-02 21:45 
Generallinking errors LNK2001 Pin
Dee25-Jun-02 17:21
Dee25-Jun-02 17:21 
GeneralRe: linking errors LNK2001 Pin
Christian Graus25-Jun-02 19:47
protectorChristian Graus25-Jun-02 19:47 
QuestionHow to change the size of a splitview? Pin
aldeba25-Jun-02 16:44
aldeba25-Jun-02 16:44 
AnswerRe: How to change the size of a splitview? Pin
aldeba25-Jun-02 16:54
aldeba25-Jun-02 16:54 
QuestionDirectly creating a CFormView as a child? Pin
DerekSaw25-Jun-02 16:34
DerekSaw25-Jun-02 16:34 
AnswerRe: Directly creating a CFormView as a child? Pin
aldeba25-Jun-02 16:45
aldeba25-Jun-02 16:45 
AnswerRe: Directly creating a CFormView as a child? Pin
DerekSaw25-Jun-02 16:52
DerekSaw25-Jun-02 16:52 
GeneralRe: Directly creating a CFormView as a child? Pin
aldeba25-Jun-02 19:58
aldeba25-Jun-02 19:58 
GeneralRe: Directly creating a CFormView as a child? Pin
DerekSaw25-Jun-02 22:06
DerekSaw25-Jun-02 22:06 
GeneralRe: Directly creating a CFormView as a child? Pin
Michael P Butler25-Jun-02 22:28
Michael P Butler25-Jun-02 22:28 

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.