Click here to Skip to main content
15,893,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Computer freezing up on wait Pin
Jack Puppy12-Apr-05 13:06
Jack Puppy12-Apr-05 13:06 
GeneralRe: Computer freezing up on wait Pin
theFrenchHornet13-Apr-05 5:01
theFrenchHornet13-Apr-05 5:01 
GeneralRe: Computer freezing up on wait Pin
theFrenchHornet14-Apr-05 6:35
theFrenchHornet14-Apr-05 6:35 
GeneralRe: Computer freezing up on wait Pin
Blake Miller14-Apr-05 9:29
Blake Miller14-Apr-05 9:29 
GeneralRe: Computer freezing up on wait Pin
Blake Miller13-Apr-05 6:52
Blake Miller13-Apr-05 6:52 
GeneralRe: Computer freezing up on wait Pin
theFrenchHornet14-Apr-05 6:33
theFrenchHornet14-Apr-05 6:33 
GeneralReading A File Pin
LighthouseJ12-Apr-05 11:33
LighthouseJ12-Apr-05 11:33 
GeneralFollow-Up Pin
LighthouseJ12-Apr-05 16:03
LighthouseJ12-Apr-05 16:03 
I traced through the read and here's what I found...

In the file pointer structure, there is a _ptr and a _cnt variable. When I open a file, the system seems to read in a chunk into memory and position _ptr at the front of it. As I read, the _ptr advances through the memory, and _cnt counts down to stop the read at the end of the chunk. When _cnt reaches zero, that may be a signal to the system to grab more data. Upon the signal, a new chunk of data overwrites the old data in the same memory area to save space, _cnt is reset to the amount of data it read in and _ptr points back to the beginning.

That sounds reasonable to me, however the data it reads in is very incorrect after the first block. I have the same file open in a hex editor and it's fine so the data is not corrupt. In the meantime, I may (relucantly) try a different method of reading a file, like iostream instead of file pointers but this is just disappointing to me. If anyone can say "it's because of X. Add "this statement;" and it'll work like a champ, I'll buy you a pint.
GeneralRe: Follow-Up Pin
John R. Shaw12-Apr-05 19:16
John R. Shaw12-Apr-05 19:16 
GeneralRe: Follow-Up Pin
LighthouseJ12-Apr-05 19:30
LighthouseJ12-Apr-05 19:30 
GeneralRe: Follow-Up Pin
John R. Shaw12-Apr-05 20:43
John R. Shaw12-Apr-05 20:43 
GeneralRe: Follow-Up Pin
LighthouseJ13-Apr-05 4:02
LighthouseJ13-Apr-05 4:02 
GeneralRe: Reading A File Pin
Ryan Binns12-Apr-05 18:25
Ryan Binns12-Apr-05 18:25 
GeneralRe: Reading A File Pin
LighthouseJ12-Apr-05 19:16
LighthouseJ12-Apr-05 19:16 
GeneralRe: Reading A File Pin
namaskaaram12-Apr-05 21:20
namaskaaram12-Apr-05 21:20 
GeneralRe: Reading A File Pin
LighthouseJ13-Apr-05 4:01
LighthouseJ13-Apr-05 4:01 
GeneralRe: Reading A File Pin
Blake Miller13-Apr-05 7:12
Blake Miller13-Apr-05 7:12 
GeneralRe: Reading A File Pin
namaskaaram13-Apr-05 19:36
namaskaaram13-Apr-05 19:36 
Generalserial port comm at low baud rate (50/75 /100 baud) in windows Pin
pcm21112-Apr-05 8:40
pcm21112-Apr-05 8:40 
GeneralCToolBar and CToolBatCtrl Pin
odiesback12-Apr-05 8:40
odiesback12-Apr-05 8:40 
GeneralRe: CToolBar and CToolBatCtrl Pin
Jack Puppy12-Apr-05 12:50
Jack Puppy12-Apr-05 12:50 
GeneralRe: CToolBar and CToolBatCtrl Pin
odiesback13-Apr-05 4:33
odiesback13-Apr-05 4:33 
GeneralAdding a file to Windows MRU Pin
yarp12-Apr-05 8:36
yarp12-Apr-05 8:36 
GeneralRe: Adding a file to Windows MRU Pin
Gary Kirkham12-Apr-05 8:38
Gary Kirkham12-Apr-05 8:38 
GeneralRe: Adding a file to Windows MRU Pin
yarp12-Apr-05 9:00
yarp12-Apr-05 9:00 

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.