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

C / C++ / MFC

 
QuestionRe: Over Writing in File System... Pin
Ahmed Charfeddine20-Dec-09 21:27
Ahmed Charfeddine20-Dec-09 21:27 
AnswerRe: Over Writing in File System... Pin
hrishiS20-Dec-09 21:30
hrishiS20-Dec-09 21:30 
GeneralRe: Over Writing in File System... Pin
Ahmed Charfeddine20-Dec-09 21:34
Ahmed Charfeddine20-Dec-09 21:34 
GeneralDo not surrender Pin
Ahmed Charfeddine20-Dec-09 21:36
Ahmed Charfeddine20-Dec-09 21:36 
GeneralRe: Do not surrender Pin
hrishiS20-Dec-09 21:45
hrishiS20-Dec-09 21:45 
AnswerRe: Over Writing in File System... Pin
Richard MacCutchan20-Dec-09 21:27
mveRichard MacCutchan20-Dec-09 21:27 
GeneralRe: Over Writing in File System... Pin
hrishiS20-Dec-09 21:31
hrishiS20-Dec-09 21:31 
AnswerRe: Over Writing in File System... Pin
Code-o-mat20-Dec-09 22:24
Code-o-mat20-Dec-09 22:24 
hrishiS wrote:
...Read the file with size of A (in order to point the file pointer to the next memory..ie starting of struct B).

-just an...hmm, how to say..."architectural" note here, you can use seeking (fseek[^], CFile::Seek[^], don't know how you work with your file) to position the file pointer, so if you know that your file contains A B and C in this order and you know their sizes you can position the file pointer at the beginning of B by seeking from the beginning of the file to sizeof(A) position, this way you don't need to read the A struct and can save up on speed and memory, i know this doesn't really make much of a difference when your structs are small.
After wirting to the file, did you close it and reopen it and then read A and B (and maybe C) to check the result of your previous write? If you are doing the writing and then reading of your B structure "in the same session", without closign the file, did you seek back to the start of the B structure before reading?

> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <

QuestionIcons In VC++ Pin
jannathali20-Dec-09 19:52
jannathali20-Dec-09 19:52 
AnswerRe: Icons In VC++ Pin
KingsGambit20-Dec-09 20:25
KingsGambit20-Dec-09 20:25 
AnswerRe: Icons In VC++ Pin
Code-o-mat20-Dec-09 20:48
Code-o-mat20-Dec-09 20:48 
QuestionRunning a windows service in Windows7 Pin
beko20-Dec-09 19:48
beko20-Dec-09 19:48 
QuestionSetWindowPos : Debug assertion Pin
Anu_Bala20-Dec-09 19:33
Anu_Bala20-Dec-09 19:33 
AnswerRe: SetWindowPos : Debug assertion Pin
KingsGambit20-Dec-09 20:21
KingsGambit20-Dec-09 20:21 
GeneralRe: SetWindowPos : Debug assertion Pin
Anu_Bala20-Dec-09 20:29
Anu_Bala20-Dec-09 20:29 
GeneralRe: SetWindowPos : Debug assertion Pin
KingsGambit20-Dec-09 20:30
KingsGambit20-Dec-09 20:30 
GeneralRe: SetWindowPos : Debug assertion Pin
Anu_Bala20-Dec-09 21:31
Anu_Bala20-Dec-09 21:31 
QuestionRe: SetWindowPos : Debug assertion Pin
CPallini20-Dec-09 22:11
mveCPallini20-Dec-09 22:11 
AnswerRe: SetWindowPos : Debug assertion Pin
Anu_Bala20-Dec-09 22:21
Anu_Bala20-Dec-09 22:21 
QuestionRe: SetWindowPos : Debug assertion Pin
CPallini20-Dec-09 22:25
mveCPallini20-Dec-09 22:25 
AnswerRe: SetWindowPos : Debug assertion Pin
Anu_Bala20-Dec-09 22:31
Anu_Bala20-Dec-09 22:31 
QuestionRe: SetWindowPos : Debug assertion Pin
CPallini20-Dec-09 22:39
mveCPallini20-Dec-09 22:39 
AnswerRe: SetWindowPos : Debug assertion [modified] Pin
Tim Craig21-Dec-09 12:36
Tim Craig21-Dec-09 12:36 
GeneralRe: SetWindowPos : Debug assertion Pin
CPallini21-Dec-09 20:34
mveCPallini21-Dec-09 20:34 
GeneralRe: SetWindowPos : Debug assertion Pin
Tim Craig21-Dec-09 21:18
Tim Craig21-Dec-09 21: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.