Click here to Skip to main content
15,909,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRecursively reading from registry Pin
mark%whitedust.net10-Oct-03 4:02
mark%whitedust.net10-Oct-03 4:02 
GeneralRe: Recursively reading from registry Pin
Jonathan [Darka]10-Oct-03 4:10
professionalJonathan [Darka]10-Oct-03 4:10 
GeneralRe: Recursively reading from registry Pin
mark%whitedust.net10-Oct-03 4:18
mark%whitedust.net10-Oct-03 4:18 
GeneralRe: Recursively reading from registry Pin
Jonathan [Darka]10-Oct-03 4:20
professionalJonathan [Darka]10-Oct-03 4:20 
GeneralRe: Recursively reading from registry Pin
Michael Dunn10-Oct-03 4:53
sitebuilderMichael Dunn10-Oct-03 4:53 
QuestionHow to call virtual method at CWnd derived class? Pin
vgrigor10-Oct-03 3:49
vgrigor10-Oct-03 3:49 
QuestionHow to use CXIMAGE for printing??? Pin
radha vijay10-Oct-03 2:46
radha vijay10-Oct-03 2:46 
Generalhowto do a splitter in mfc without using views Pin
HeiniBlad10-Oct-03 2:46
HeiniBlad10-Oct-03 2:46 
GeneralRe: howto do a splitter in mfc without using views Pin
jhwurmbach10-Oct-03 2:52
jhwurmbach10-Oct-03 2:52 
Generalfunction template Pin
[CoY0te]10-Oct-03 2:36
[CoY0te]10-Oct-03 2:36 
Generalfunction template (update) Pin
[CoY0te]10-Oct-03 3:15
[CoY0te]10-Oct-03 3:15 
GeneralC/C++ goodies here! Pin
TW10-Oct-03 2:21
TW10-Oct-03 2:21 
GeneralRe: C/C++ goodies here! Pin
Anthony_Yio10-Oct-03 23:16
Anthony_Yio10-Oct-03 23:16 
GeneralUnable to change menus in Visual C++ 6 Pin
Oliver Christian Kjær10-Oct-03 1:50
Oliver Christian Kjær10-Oct-03 1:50 
GeneralRe: Unable to change menus in Visual C++ 6 Pin
Steve S10-Oct-03 1:57
Steve S10-Oct-03 1:57 
GeneralRe: Unable to change menus in Visual C++ 6 Pin
Oliver Christian Kjær10-Oct-03 2:29
Oliver Christian Kjær10-Oct-03 2:29 
GeneralRe: Unable to change menus in Visual C++ 6 Pin
Oliver Christian Kjær10-Oct-03 3:28
Oliver Christian Kjær10-Oct-03 3:28 
GeneralRe: Unable to change menus in Visual C++ 6 Pin
Steve S13-Oct-03 5:31
Steve S13-Oct-03 5:31 
GeneralRe: Unable to change menus in Visual C++ 6 Pin
Oliver Christian Kjær14-Oct-03 21:41
Oliver Christian Kjær14-Oct-03 21:41 
Generalfloat precision Pin
OO-P10-Oct-03 1:11
OO-P10-Oct-03 1:11 
GeneralRe: float precision Pin
Anthony_Yio10-Oct-03 1:33
Anthony_Yio10-Oct-03 1:33 
GeneralRichEdit with Treeview - associating and saving Pin
Kayembi10-Oct-03 0:49
Kayembi10-Oct-03 0:49 
Hi,

I am currently working on a small app that I hope to make partly a combination of a basic word processor with an Explorer-like tree. Thus, on the left there is a tree view and on the right there is a Rich Edit box. The tree view represents virtual "documents" in a virtual filing system. By clicking or right-clicking in the tree view, you can select or create a new virtual document. The currently selected document should be shown in the rich edit box on the right, which can be typed from scratch or edited etc.

I am using the straight Windows API SDK with _no_ MFC, and I am still a relative novice code - after a few small apps, this is my first attempt at writing a piece of software I would really like to use, so please forgive me for asking basic design questions, but here goes:

1) What is the best way of associating the text in a rich edit box with a tree view item? I was initially thinking of associating a string (Rich Edit) with an HTREEITEM, as I have used this method before, eg:

<pseudo code="">
HTREEITEM tr1, tr2, tr3;
char* str1, str2, str3;
if(tree_item_selected == tr1)
{ ShowRichEditText(str1); }
..er, etc.


Obviously, though, this is fundamentally flawed as it would mean that there would have to be a limit to how many HTREEITEMs -and therefore documents - the user could create. In other words, I would have to create a set (large) number of strings, and the same number of HTREEITEM pointers to use this method. I would probably have to create a thousand strings or HTREEITEMs or so to make sure the user didn't run out. Could someone please suggest a better way of doing this? In essence, I just need to be able to associate an arbitrary number of strings containing RTF text with an arbitrary number of HTREEITEMs. Sorry if this is a fairly stupid question.

2) If (1) is achieved, how would I then save it to file? Would I be able to save the info as a struct or some such and just use CreateFile() and WriteFile(), or would I need something more complicated to hold this sort of info?

Many thanks to anyone who can give me some tips, pointers, or directions to non-MFC examples, and even more thanks to all those who have put up with my newbie questions and given me help over the past couple of months. Smile | :)
Cheers,
KB
GeneralRe: RichEdit with Treeview - associating and saving Pin
Steve S10-Oct-03 1:42
Steve S10-Oct-03 1:42 
GeneralMFC printing: size and orientation Pin
zsnow9-Oct-03 23:40
zsnow9-Oct-03 23:40 
GeneralRe: MFC printing: size and orientation Pin
Steve S10-Oct-03 1:39
Steve S10-Oct-03 1:39 

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.