Click here to Skip to main content
15,906,708 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with read in CFile class Pin
antonio34321-Oct-11 22:26
antonio34321-Oct-11 22:26 
GeneralRe: Problem with read in CFile class Pin
Richard MacCutchan22-Oct-11 0:07
mveRichard MacCutchan22-Oct-11 0:07 
GeneralRe: Problem with read in CFile class Pin
antonio34322-Oct-11 0:33
antonio34322-Oct-11 0:33 
GeneralRe: Problem with read in CFile class Pin
Richard MacCutchan22-Oct-11 0:56
mveRichard MacCutchan22-Oct-11 0:56 
GeneralRe: Problem with read in CFile class Pin
antonio34322-Oct-11 1:09
antonio34322-Oct-11 1:09 
GeneralRe: Problem with read in CFile class Pin
Richard MacCutchan22-Oct-11 1:44
mveRichard MacCutchan22-Oct-11 1:44 
GeneralRe: Problem with read in CFile class Pin
antonio34322-Oct-11 8:21
antonio34322-Oct-11 8:21 
GeneralRe: Problem with read in CFile class Pin
Chuck O'Toole22-Oct-11 9:44
Chuck O'Toole22-Oct-11 9:44 
"Here is the content of the file"...

Just how are you getting that output to show us? Is that from some editor or file dump utility?

If you write a file containing some binary data (and you do, both 'nLength' and 'a' are written to the file as plain binary data), and then you ask an editor to display the content of the file, of course you are going to get garbage.

Editors make the reasonable assumption that the entire data file is 'char' and will attempt to interpret the file in that way, rendering all the characters into some printable form, including trash characters as you observe.

For binary data, editors and other display programs are inappropriate for looking at the contents to see if it is correct. Raw binary file dumpers are the best for that, then you can see every byte.
GeneralRe: Problem with read in CFile class Pin
Richard MacCutchan22-Oct-11 21:33
mveRichard MacCutchan22-Oct-11 21:33 
GeneralRe: Problem with read in CFile class Pin
antonio34323-Oct-11 0:43
antonio34323-Oct-11 0:43 
QuestionMFC dialog + ResizableLib + splitter Pin
Dialecticus21-Oct-11 5:05
Dialecticus21-Oct-11 5:05 
AnswerRe: MFC dialog + ResizableLib + splitter Pin
Richard MacCutchan21-Oct-11 6:26
mveRichard MacCutchan21-Oct-11 6:26 
AnswerRe: MFC dialog + ResizableLib + splitter Pin
TheGreatAndPowerfulOz21-Oct-11 9:17
TheGreatAndPowerfulOz21-Oct-11 9:17 
QuestionProblem with MPR.lib/MFC90.DLL Pin
tasumisra20-Oct-11 17:41
tasumisra20-Oct-11 17:41 
AnswerRe: Problem with MPR.lib/MFC90.DLL Pin
Richard MacCutchan20-Oct-11 21:41
mveRichard MacCutchan20-Oct-11 21:41 
GeneralRe: Problem with MPR.lib/MFC90.DLL Pin
tasumisra20-Oct-11 21:58
tasumisra20-Oct-11 21:58 
GeneralRe: Problem with MPR.lib/MFC90.DLL Pin
Richard MacCutchan20-Oct-11 23:01
mveRichard MacCutchan20-Oct-11 23:01 
GeneralRe: Problem with MPR.lib/MFC90.DLL Pin
tasumisra24-Oct-11 2:03
tasumisra24-Oct-11 2:03 
GeneralRe: Problem with MPR.lib/MFC90.DLL Pin
Richard MacCutchan24-Oct-11 3:46
mveRichard MacCutchan24-Oct-11 3:46 
AnswerRe: Fix the registry Pin
Goto_Label_21-Oct-11 6:59
Goto_Label_21-Oct-11 6:59 
QuestionvString Pin
Tyler Elric20-Oct-11 16:48
Tyler Elric20-Oct-11 16:48 
AnswerRe: vString Pin
Tyler Elric20-Oct-11 16:57
Tyler Elric20-Oct-11 16:57 
AnswerRe: vString Pin
Richard Andrew x6420-Oct-11 18:02
professionalRichard Andrew x6420-Oct-11 18:02 
GeneralRe: vString Pin
Tyler Elric21-Oct-11 1:50
Tyler Elric21-Oct-11 1:50 
QuestionRe: vString Pin
Niklas L21-Oct-11 3:21
Niklas L21-Oct-11 3:21 

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.