Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regular expression Pin
John R. Shaw12-Apr-05 18:11
John R. Shaw12-Apr-05 18:11 
QuestionWM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi12-Apr-05 16:39
Hamed Musavi12-Apr-05 16:39 
AnswerRe: WM_CHAR, WM_KEYDOWN??? Pin
Christian Graus12-Apr-05 17:49
protectorChristian Graus12-Apr-05 17:49 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi14-Apr-05 15:41
Hamed Musavi14-Apr-05 15:41 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Christian Graus14-Apr-05 15:43
protectorChristian Graus14-Apr-05 15:43 
GeneralRe: WM_CHAR, WM_KEYDOWN??? Pin
Hamed Musavi14-Apr-05 15:47
Hamed Musavi14-Apr-05 15:47 
GeneralFolder Calls Pin
JWood12-Apr-05 16:20
JWood12-Apr-05 16:20 
GeneralRe: Folder Calls Pin
David Crow12-Apr-05 17:01
David Crow12-Apr-05 17:01 
GeneralRe: Folder Calls Pin
John R. Shaw12-Apr-05 19:30
John R. Shaw12-Apr-05 19:30 
GeneralWhy isn't my Dialog REPAINT Pin
Jobby Joseph12-Apr-05 13:42
Jobby Joseph12-Apr-05 13:42 
GeneralRe: Why isn't my Dialog REPAINT Pin
John R. Shaw12-Apr-05 17:47
John R. Shaw12-Apr-05 17:47 
GeneralRe: Why isn't my Dialog REPAINT Pin
Jobby Joseph13-Apr-05 4:18
Jobby Joseph13-Apr-05 4:18 
GeneralRe: Why isn't my Dialog REPAINT Pin
Jobby Joseph13-Apr-05 10:57
Jobby Joseph13-Apr-05 10:57 
GeneralComputer freezing up on wait Pin
theFrenchHornet12-Apr-05 12:08
theFrenchHornet12-Apr-05 12:08 
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 
I don't see how this got to be a problem, but I'm trying to read a bitmap file data in a raw fashion, byte by byte. I'm dealing with 8-bit images and therefore my data starts at 0x436 (1078 bytes from the beginning of the file). I'm trying to read the file in 64-byte chunks using file pointers. I've used fseek to position the data read pointer at the start of the data properly and it starts to read fine. When it gets to byte 62, that's when the problems begin. I have a variable that's set by ftell to tell me the file position which I interpret it to be the byte offset from the start of the file. Before the problem, the characters are fine and the file position is where it should be. Once it hits byte 62, the characters it gets are different from what it should be and the file position reads 5175 instead of 1141 for byte 63.

Here's 96 bytes of what I'm trying to read from:
1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E
1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1D 1D 1C 1C 1B 1D 1C 1B 1B 1A 1D
1D 1B 1B 1B 1B 1B 1C 1D 1B 1C 1C 1D 1D 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E


Here's the result, I've bolded the bytes that are different:
1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E
1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1D 1D 1C 1C 1B 1D 1C 1B 1B 1E 1E
1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E 1E


The 1E's at the end of the snip are probably 1E's from somewhere else, the picture I'm reading is of a very white moon on a very black background. Any help would be greatly appreciated because this is an annoying problem.

edit: I was using fgetc to get a char (cast into a BYTE), but I tried using fscanf but the behavior is still the same, quite strange.
GeneralFollow-Up Pin
LighthouseJ12-Apr-05 16:03
LighthouseJ12-Apr-05 16:03 
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 

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.