Click here to Skip to main content
15,905,233 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHakars: access another comoputer via Internet Pin
Fad B28-Jul-03 23:06
Fad B28-Jul-03 23:06 
GeneralRe: Hakars: access another comoputer via Internet Pin
Alexander M.,29-Jul-03 9:25
Alexander M.,29-Jul-03 9:25 
GeneralCTreeView Pin
frackasse28-Jul-03 22:57
frackasse28-Jul-03 22:57 
GeneralRe: CTreeView Pin
Arjan Schouten28-Jul-03 23:25
Arjan Schouten28-Jul-03 23:25 
GeneralI need help to display a dialog from Resource-only DLL Pin
Cheickna28-Jul-03 22:46
Cheickna28-Jul-03 22:46 
GeneralRe: I need help to display a dialog from Resource-only DLL Pin
wb28-Jul-03 23:26
wb28-Jul-03 23:26 
GeneralRe: I need help to display a dialog from Resource-only DLL Pin
Ryan Binns29-Jul-03 0:18
Ryan Binns29-Jul-03 0:18 
Questionhow to read a file correctly ;) Pin
User-37793628-Jul-03 22:37
User-37793628-Jul-03 22:37 
hi there Smile | :)

sorry for this question and dont kill me Smile | :) thanks Smile | :)

(at the moment i work on pocket pc - so there are missing some desktop mfc stuff - but i think its a generally c++ question)

i want to read a file line by line. is it a "good" way to read only once char at time and check for a \n? or is there are more "professional" way to do it?

e.g. this dummy code:

CFile file;
file.Open( L"\\file.txt", CFile::modeRead );

BYTE w[1];

CString s;

while( file.Read( &w, 1 ) != 0 )
{
if( w[ 0 ] == '\n' )
{
MessageBox( NULL, s, NULL, NULL );
s = "";
}
else
{
s.Insert( s.GetLength(), w[0] );
}
}

file.Close();
AnswerRe: how to read a file correctly ;) Pin
JensB28-Jul-03 22:43
JensB28-Jul-03 22:43 
GeneralRe: how to read a file correctly ;) Pin
User-37793628-Jul-03 22:50
User-37793628-Jul-03 22:50 
GeneralRe: how to read a file correctly ;) Pin
Bob Stanneveld29-Jul-03 1:01
Bob Stanneveld29-Jul-03 1:01 
GeneralRe: how to read a file correctly ;) Pin
David Crow29-Jul-03 2:28
David Crow29-Jul-03 2:28 
AnswerRe: how to read a file correctly ;) Pin
David Chamberlain29-Jul-03 3:05
David Chamberlain29-Jul-03 3:05 
GeneralDelete profilestring Pin
JensB28-Jul-03 22:34
JensB28-Jul-03 22:34 
GeneralRe: Delete profilestring Pin
Manfred Staiger29-Jul-03 0:49
Manfred Staiger29-Jul-03 0:49 
GeneralRe: Delete profilestring Pin
David Chamberlain29-Jul-03 3:11
David Chamberlain29-Jul-03 3:11 
GeneralRe: Delete profilestring Pin
Andy Bantly20-Aug-13 8:18
Andy Bantly20-Aug-13 8:18 
GeneralAbout ftp Pin
Scozturk28-Jul-03 22:32
professionalScozturk28-Jul-03 22:32 
GeneralRe: About ftp Pin
David Crow29-Jul-03 2:35
David Crow29-Jul-03 2:35 
GeneralOnAfterPrint Event Pin
Keith Worden28-Jul-03 22:25
Keith Worden28-Jul-03 22:25 
Questionhow I show *.mdb table on a dialog ? Pin
Emre Zorlu28-Jul-03 21:02
Emre Zorlu28-Jul-03 21:02 
AnswerRe: how I show *.mdb table on a dialog ? Pin
Exceter28-Jul-03 21:46
Exceter28-Jul-03 21:46 
GeneralRe: how I show *.mdb table on a dialog ? Pin
Emre Zorlu28-Jul-03 22:27
Emre Zorlu28-Jul-03 22:27 
GeneralRe: how I show *.mdb table on a dialog ? Pin
Cheickna28-Jul-03 23:31
Cheickna28-Jul-03 23:31 
AnswerRe: how I show *.mdb table on a dialog ? Pin
Toni7829-Jul-03 15:42
Toni7829-Jul-03 15:42 

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.