Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFile read problem Pin
pri_skit20-Oct-07 20:05
pri_skit20-Oct-07 20:05 
AnswerRe: File read problem Pin
karle20-Oct-07 21:36
karle20-Oct-07 21:36 
AnswerRe: File read problem Pin
KEL322-Oct-07 1:49
KEL322-Oct-07 1:49 
QuestionRe: File read problem Pin
David Crow22-Oct-07 5:25
David Crow22-Oct-07 5:25 
QuestionRe: File read problem Pin
David Crow22-Oct-07 5:28
David Crow22-Oct-07 5:28 
AnswerRe: File read problem Pin
KEL322-Oct-07 22:00
KEL322-Oct-07 22:00 
GeneralRe: File read problem Pin
David Crow23-Oct-07 2:53
David Crow23-Oct-07 2:53 
GeneralRe: File read problem Pin
KEL324-Oct-07 2:21
KEL324-Oct-07 2:21 
Yes, sorry.
I meant that,
f.Write (&FileName,sizeof(FileName));
would be the correct code to save the
object in the file, not the string that
it has allocated. I would be more clear
in future!
But the code I posted above:
f.Write(FileName.GetBuffer(20), FileName.GetLength()+1);
works. I have done it before (that's why
I decided to answer, despite the fact
I'm not an expert). Your piece of code
does the same with less code! I just
didn't have in mind that CString could
be so easily type-casted into LPCSTR
and then to void*.
But you must also use the +1, so
that the '\0' character be written.
This is needed if you don't know the size
of the string from the beginning.

No mean to argue, you are right.
Thanks for helping me in the past too. Remember this:
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&select=2117813&df=100&fr=15724.5#xx2117813xx[^]

kostas KEL

QuestionCalculate Greatset common divider Pin
shabbi8920-Oct-07 19:15
shabbi8920-Oct-07 19:15 
AnswerRe: Calculate Greatset common divider Pin
cp987620-Oct-07 20:29
cp987620-Oct-07 20:29 
QuestionRe: Calculate Greatset common divider Pin
David Crow22-Oct-07 5:30
David Crow22-Oct-07 5:30 
QuestionIsolating mathematical functions from an input string [modified] Pin
J)ker20-Oct-07 15:57
J)ker20-Oct-07 15:57 
AnswerRe: Isolating mathematical functions from an input string Pin
Christian Graus20-Oct-07 16:57
protectorChristian Graus20-Oct-07 16:57 
AnswerRe: Isolating mathematical functions from an input string Pin
KEL322-Oct-07 22:20
KEL322-Oct-07 22:20 
QuestionHow to make a dll re-entrant? Pin
henk21cm20-Oct-07 10:12
henk21cm20-Oct-07 10:12 
AnswerRe: How to make a dll re-entrant? Pin
Abdellatif_El_Khlifi20-Oct-07 11:18
Abdellatif_El_Khlifi20-Oct-07 11:18 
AnswerRe: How to make a dll re-entrant? Pin
Mark Salsbery20-Oct-07 12:55
Mark Salsbery20-Oct-07 12:55 
AnswerRe: How to make a dll re-entrant? Pin
karle20-Oct-07 21:39
karle20-Oct-07 21:39 
GeneralRe: How to make a dll re-entrant? Pin
henk21cm20-Oct-07 23:05
henk21cm20-Oct-07 23:05 
AnswerRe: How to make a dll re-entrant? Pin
knockNrod2-Sep-10 3:10
knockNrod2-Sep-10 3:10 
Questionfunction name Pin
mauree20-Oct-07 10:11
mauree20-Oct-07 10:11 
AnswerRe: function name Pin
Nemanja Trifunovic20-Oct-07 13:00
Nemanja Trifunovic20-Oct-07 13:00 
GeneralRe: function name Pin
mauree20-Oct-07 13:14
mauree20-Oct-07 13:14 
GeneralRe: function name Pin
Nemanja Trifunovic21-Oct-07 2:40
Nemanja Trifunovic21-Oct-07 2:40 
AnswerRe: function name Pin
Nelek21-Oct-07 20:34
protectorNelek21-Oct-07 20:34 

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.