|
Heje, you must be really excited about CRichEdiiitView!
You make a good point - I've looked back at the first post, and you do have a BYTE *RTF_Data; part of your data structure.
And your approach is a good one - you have two ways of looking at your data, so you have two views in a splitter window. So far so nice.
But you still have two separate questions to answer...
1a/ Shoving that document data into the view whenver it changes...
1b/ When a user types something in the richedit control, putting it back into the document - if it's readonly, this does not exist.
You can solve both of these by looking in the code for CRichEditView/Doc - some clever MFC gnome will already have the solution ready for you to copy.
2/ Serializing the MY_DATA structure to and from a file.
You can't just copy the structure in, as one of the members is a pointer. Do a search for the code for how CArray or CStringArray serializes. You'll find the first send / read a number which describes how large they are. You can adapt this idea also.
I've now typed a bunch - you'll have to try things out, and if you need further help, get back to me / us. Hopefully you'll have made a smaller problem by then!
Good fortune,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
thank you a lot! 
|
|
|
|
|
Iain Clarke wrote: 1/ Save the document information using serialise.
Wow, that's pure English!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I really need the result! PLEASE don't mix this piece with these jokes. Thank you ...
|
|
|
|
|
I can't: it is my nature, anyway, good luck.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
no no no! I didn't mind to offend you. You are, as I've told several times, a genius. ![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Jusef Marzbany wrote: no no no! I didn't mind to offend you.
I'm not hurted. At the moment you're helped by two of the best CP's members, I have nothing to say, technically, on the argument. I was sincerely wishing good luck to you (since you appeared worried).
Jusef Marzbany wrote: You are, as I've told several times, a genius.
If you recall me your postal address I'll send you the bucks ASAP.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Just a brief question regarding the Dialog Data Exchange process
The User Calls UpdateDate with a Flag "BOOL bSaveAndValidate" which seems from the MSDN
doc
To be a public member of the CDataExchange Class
However from an Artcle of the CodeProject titled "Dialog Data Exchange in MFC"
seems that the UpdateData Fuction Ccreates the CDataExchage Class
The User supplies the pointer to this class in the Overrideable DoDataExchage
method
|
|
|
|
|
Yes, what is your question ?
|
|
|
|
|
Are you just trying to throw random sentences or there is a real purpose, in your post?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Okay sorry you guys are right ...
The questions is Do I have to Create CDataExchange Object and set m_bSaveAndValidate to FLASE before calling UpdateData
thankx
|
|
|
|
|
ForNow wrote: ...before calling UpdateData
Why call it at all?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
ForNow wrote: The questions is Do I have to Create CDataExchange Object
Usually, not.
ForNow wrote: m_bSaveAndValidate to FLASE before calling UpdateData
m_bSaveAndValidate value states the direction of the update, if it is FALSE then control values are updated with values of the associated variables, on the other hand, if it is TRUE (or is missing) then the values of the associated variables are updated with the current values of the controls.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There's no need to ask us this question... You can answer it yourself with the power of the debugger!
Make a dummy dialogbox project.
Add an text box on the dialog, and double click on that to associate it with a CString member. Or int, or whatever is making you happy today.
Find the CMyDialog::DoDataExchange member function. Put a breakpoint there.
Run your software, and press f10 or click on the next-line button. You will see exactly what MFC does for you.
(Hint, UpdateData only has one parameter, and it's a BOOL)
Good luck with your discoveries,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Sorry again
Did that my question now is do the DDX/DDV macros have to live in the DoDataExchange methods
seems like that functions receives the pointer to the CDataExchange class that has the handles to the edit controls
on which do the DDX/DDV macros act on
|
|
|
|
|
Well, if you followed my instructions, you'll see where the DDX macro is. It's in the DoDataExchange method.
Have a look at the following article, it explains things far better than I can be bothered to type for you:
http://msdn.microsoft.com/en-us/library/aa293961(VS.60).aspx[^]
(I'm only a bit lazy - but the article explains the lot, with pictures!)
Enjoy,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
thankx again you r really nice
|
|
|
|
|
One more thing should the memeber varaibles in my Case a CString be part of The Dialog Object
I have made them part of the Dialog Object
thankx
|
|
|
|
|
Same answer as before... When you used the class wizard to put a string in, where did you put it.
And to reflect your question back at you... Where else can member variables be if not part of an object.
Longer answer:
The DDX_xxxx functions will work on any int / CString / thing, but unless you have a good reason to work on something that's not a member of the dialog class that the DoDataExchange method is a member of, don't do it!
As your understanding is obviously basic [*], I'd stay with boring defualt stuff for now.
Iain.
[*] No offense: We all were beginners once. I'll only insult people if they fail to learn, not when they're starting.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
thhankx for being patient with a rookie
|
|
|
|
|
There should be the option "No question " or "Where is the frickin' question " besides "Bad Question " and "Good Question ".
|
|
|
|
|
hey look, when you post as a joke, it does not show Good Question - Bad Question .
May be should have Good Joke - Bad Joke - Bad bad bad bad joke .
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
this is why I left this forum ; too much idiotic question, wasting my time and pulling down the level of this place... too bad.
|
|
|
|
|
toxcct wrote: too much idiotic question
Have you had a look at the C# forum?
|
|
|
|
|
yes, and I even have my agents reporting the worst questions ever in the ASP.NET forum... lol
|
|
|
|