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

C / C++ / MFC

 
GeneralRe: Dumb loop question. Pin
RobJones15-Jul-04 9:24
RobJones15-Jul-04 9:24 
GeneralRe: Dumb loop question. Pin
palbano15-Jul-04 9:30
palbano15-Jul-04 9:30 
GeneralRe: Dumb loop question. Pin
RobJones15-Jul-04 9:50
RobJones15-Jul-04 9:50 
GeneralRe: Dumb loop question. Pin
palbano15-Jul-04 17:54
palbano15-Jul-04 17:54 
Generaltypedef Pin
Adam Durity15-Jul-04 8:31
Adam Durity15-Jul-04 8:31 
GeneralRe: typedef Pin
Maximilien15-Jul-04 8:35
Maximilien15-Jul-04 8:35 
GeneralASCII strings from file Pin
Oriocat15-Jul-04 8:24
Oriocat15-Jul-04 8:24 
GeneralRe: ASCII strings from file Pin
Antti Keskinen15-Jul-04 9:28
Antti Keskinen15-Jul-04 9:28 
Open the file, read it completely into a buffer, convert the buffer into a CString, and use it's powerful searching functions to find what you need.

An alternative is to open the file, and use the file pointer to check adjacent characters if they match your search criteria. This is a LOT slower way code-wise, but uses less memory, as no extra CString objects are needed.

If you can't use MFC, then use normal string searching functions such as strspn on the buffer. Do not search through the direct file pointer (although files may be considered as buffers), because this will lead to problems if different file systems are used.

For reference, see MSDN or any C++ book for functions like fopen, fread and so on.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralUser WM messages Pin
0v3rloader15-Jul-04 7:07
0v3rloader15-Jul-04 7:07 
GeneralRe: User WM messages Pin
vcplusplus15-Jul-04 7:16
vcplusplus15-Jul-04 7:16 
GeneralRe: User WM messages Pin
Maximilien15-Jul-04 7:37
Maximilien15-Jul-04 7:37 
GeneralRe: User WM messages Pin
Duncan Edwards Jones15-Jul-04 8:23
professionalDuncan Edwards Jones15-Jul-04 8:23 
GeneralRe: User WM messages Pin
0v3rloader15-Jul-04 10:05
0v3rloader15-Jul-04 10:05 
GeneralIntercepting RETURN produces a beep Pin
srev15-Jul-04 6:13
srev15-Jul-04 6:13 
GeneralRe: Intercepting RETURN produces a beep Pin
l a u r e n15-Jul-04 9:50
l a u r e n15-Jul-04 9:50 
GeneralPorting MFC applications to other machines Pin
TallAndyB15-Jul-04 5:50
TallAndyB15-Jul-04 5:50 
GeneralRe: Porting MFC applications to other machines Pin
Michael P Butler15-Jul-04 6:01
Michael P Butler15-Jul-04 6:01 
GeneralRe: Porting MFC applications to other machines Pin
Maximilien15-Jul-04 9:33
Maximilien15-Jul-04 9:33 
GeneralRe: Porting MFC applications to other machines Pin
Henry miller15-Jul-04 12:19
Henry miller15-Jul-04 12:19 
GeneralRe: Porting MFC applications to other machines Pin
TallAndyB21-Jul-04 4:40
TallAndyB21-Jul-04 4:40 
Generalcrystal reports in visual studio.net 2003 Pin
Irish_GUI15-Jul-04 4:58
Irish_GUI15-Jul-04 4:58 
GeneralCTabCtrl Query Pin
Tariq87815-Jul-04 4:53
Tariq87815-Jul-04 4:53 
Generalputting hex calues in a byte array Pin
pankajdaga15-Jul-04 4:48
pankajdaga15-Jul-04 4:48 
GeneralRe: putting hex calues in a byte array Pin
Antony M Kancidrowski15-Jul-04 4:58
Antony M Kancidrowski15-Jul-04 4:58 
GeneralRe: putting hex calues in a byte array Pin
V.15-Jul-04 5:04
professionalV.15-Jul-04 5:04 

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.