Click here to Skip to main content
15,887,337 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 7:53
antonio34311-Oct-11 7:53 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 8:08
mveRichard MacCutchan11-Oct-11 8:08 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:30
antonio34311-Oct-11 8:30 
AnswerRe: how to write/read in text file with mfc project?? Pin
Maximilien11-Oct-11 7:55
Maximilien11-Oct-11 7:55 
AnswerRe: how to write/read in text file with mfc project?? Pin
Chris Meech11-Oct-11 7:59
Chris Meech11-Oct-11 7:59 
AnswerRe: how to write/read in text file with mfc project?? Pin
Madhu Nair11-Oct-11 8:02
Madhu Nair11-Oct-11 8:02 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:19
antonio34311-Oct-11 8:19 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 8:36
mveRichard MacCutchan11-Oct-11 8:36 
In your original code you were writing from an uninitialised buffer, hence the garbage recorded in your file. Check the logic of your code thus:

  1. Create the file with access for writing
  2. Write some text either from a constant string, or from some data built by the program
  3. Close the file
  4. Open the file with access for reading
  5. Read the text into a buffer
  6. Close the file

In each case check the results of your function calls to ensure that your code has completed without error. You can also create your file manually using Notepad or similar text editor.
Unrequited desire is character building. OriginalGriff


GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:51
antonio34311-Oct-11 8:51 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 10:58
mveRichard MacCutchan11-Oct-11 10:58 
QuestionRe: how to write/read in text file with mfc project?? Pin
David Crow11-Oct-11 10:28
David Crow11-Oct-11 10:28 
AnswerRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 14:12
antonio34311-Oct-11 14:12 
GeneralRe: how to write/read in text file with mfc project?? Pin
enhzflep11-Oct-11 14:32
enhzflep11-Oct-11 14:32 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 15:03
antonio34311-Oct-11 15:03 
GeneralRe: how to write/read in text file with mfc project?? Pin
enhzflep11-Oct-11 15:39
enhzflep11-Oct-11 15:39 
QuestionHow to get list of COM Ports in Win32 Pin
pandit8411-Oct-11 0:57
pandit8411-Oct-11 0:57 
AnswerRe: How to get list of COM Ports in Win32 Pin
App_11-Oct-11 1:03
App_11-Oct-11 1:03 
AnswerRe: How to get list of COM Ports in Win32 Pin
Madhu Nair11-Oct-11 1:15
Madhu Nair11-Oct-11 1:15 
GeneralRe: How to get list of COM Ports in Win32 Pin
Albert Holguin11-Oct-11 4:23
professionalAlbert Holguin11-Oct-11 4:23 
GeneralRe: How to get list of COM Ports in Win32 Pin
Madhu Nair11-Oct-11 6:44
Madhu Nair11-Oct-11 6:44 
GeneralRe: How to get list of COM Ports in Win32 Pin
Albert Holguin12-Oct-11 5:16
professionalAlbert Holguin12-Oct-11 5:16 
GeneralRe: How to get list of COM Ports in Win32 Pin
Jonathan Davies17-Oct-11 1:22
Jonathan Davies17-Oct-11 1:22 
AnswerRe: CreateFile function Pin
Software_Developer11-Oct-11 3:01
Software_Developer11-Oct-11 3:01 
GeneralRe: CreateFile function Pin
Richard Andrew x6411-Oct-11 11:33
professionalRichard Andrew x6411-Oct-11 11:33 
GeneralRe: CreateFile function Pin
Peter_in_278011-Oct-11 12:06
professionalPeter_in_278011-Oct-11 12:06 

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.