Click here to Skip to main content
15,898,134 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: MFC printing: size and orientation Pin
zsnow10-Oct-03 2:14
zsnow10-Oct-03 2:14 
GeneralRe: MFC printing: size and orientation Pin
Steve S10-Oct-03 4:48
Steve S10-Oct-03 4:48 
GeneralRe: MFC printing: size and orientation Pin
Steve S10-Oct-03 4:56
Steve S10-Oct-03 4:56 
GeneralPrintDlgEx Pin
«_Superman_»9-Oct-03 23:11
professional«_Superman_»9-Oct-03 23:11 
GeneralAn interesting code Pin
FlyingDancer9-Oct-03 21:44
FlyingDancer9-Oct-03 21:44 
GeneralWhat does this do? Pin
Joaquín M López Muñoz9-Oct-03 21:51
Joaquín M López Muñoz9-Oct-03 21:51 
GeneralRe: What does this do? Pin
FlyingDancer9-Oct-03 22:20
FlyingDancer9-Oct-03 22:20 
GeneralRe: What does this do? Pin
jhwurmbach9-Oct-03 22:44
jhwurmbach9-Oct-03 22:44 
GeneralRe: What does this do? Pin
FlyingDancer9-Oct-03 23:24
FlyingDancer9-Oct-03 23:24 
GeneralRe: What does this do? Pin
jhwurmbach10-Oct-03 1:31
jhwurmbach10-Oct-03 1:31 
GeneralRe: What does this do? Pin
Steve S10-Oct-03 1:44
Steve S10-Oct-03 1:44 
GeneralRe: What does this do? Pin
jhwurmbach10-Oct-03 1:50
jhwurmbach10-Oct-03 1:50 
GeneralRe: What does this do? Pin
Steve S10-Oct-03 2:01
Steve S10-Oct-03 2:01 
GeneralRe: What does this do? Pin
FlyingDancer11-Oct-03 5:18
FlyingDancer11-Oct-03 5:18 

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.