Click here to Skip to main content
15,917,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: vbcrlf function Pin
BlackDice12-Oct-04 3:07
BlackDice12-Oct-04 3:07 
QuestionHow to compile and run the RTC Client API v1.2 samples Pin
pubududilena11-Oct-04 21:08
pubududilena11-Oct-04 21:08 
GeneralMachine Cycle Pin
Victor Arokiam11-Oct-04 20:20
Victor Arokiam11-Oct-04 20:20 
GeneralRe: Machine Cycle Pin
Jim Crafton12-Oct-04 5:13
Jim Crafton12-Oct-04 5:13 
GeneralRe: Machine Cycle Pin
Anonymous13-Oct-04 18:31
Anonymous13-Oct-04 18:31 
GeneralOnVScroll() vs OnMouseWheel() Pin
Jesper Knudsen11-Oct-04 20:15
Jesper Knudsen11-Oct-04 20:15 
Generalphp upload to file Pin
Spiritofamerica11-Oct-04 19:39
Spiritofamerica11-Oct-04 19:39 
GeneralRead a Text Pin
picasso211-Oct-04 19:19
picasso211-Oct-04 19:19 
I created a simple application that contains a text field (member variable CString m_Data)and OK button
When user clicks OK button the file text.txt is read.

text.txt contains
LINE 0
LINE2
LINE3
LINE4

How can I skip the first line and display the second line in the text field ? (e.g LINE1)
Is there a better way?
Idealy what I want is to load second line then user clicks next and the third line is loaded and so on

I tried this but it does not skip first line

///////////////////////////
CFile cf;

if(cf.Open("text.txt",CFile::modeRead))
{

int nFileSize = cf.GetLength();
char * lpBuffer = new char [nFileSize+1];
cf.Read(lpBuffer,nFileSize);

m_Data = lpBuffer;
delete []lpBuffer;

}
else
{
MessageBox ("not loaded","Can not open file", MB_OK);
}
}
Any help will be greatly appreciated

GeneralRe: Read a Text Pin
Sujan Christo11-Oct-04 19:50
Sujan Christo11-Oct-04 19:50 
GeneralRe: Read a Text Pin
RChin11-Oct-04 23:01
RChin11-Oct-04 23:01 
GeneralProblem with Microsoft Unicode layer on Windows 98 Pin
Pruthviraj11-Oct-04 19:06
Pruthviraj11-Oct-04 19:06 
Generaldynamic menus Pin
Tyrus18211-Oct-04 18:39
Tyrus18211-Oct-04 18:39 
GeneralRe: dynamic menus Pin
Roger Allen12-Oct-04 10:51
Roger Allen12-Oct-04 10:51 
QuestionHow can I Set Background color for a Static text ? Pin
King of Merit11-Oct-04 18:27
King of Merit11-Oct-04 18:27 
AnswerRe: How can I Set Background color for a Static text ? Pin
Sujan Christo11-Oct-04 18:35
Sujan Christo11-Oct-04 18:35 
AnswerRe: How can I Set Background color for a Static text ? Pin
Ravi Bhavnani12-Oct-04 4:03
professionalRavi Bhavnani12-Oct-04 4:03 
GeneralProb on Multi-Threaded Application Pin
Sujan Christo11-Oct-04 18:16
Sujan Christo11-Oct-04 18:16 
GeneralRe: Prob on Multi-Threaded Application Pin
Blake Miller12-Oct-04 5:17
Blake Miller12-Oct-04 5:17 
GeneralWorking directory problem Pin
smbika11-Oct-04 16:52
smbika11-Oct-04 16:52 
GeneralRe: Working directory problem Pin
alex.barylski11-Oct-04 17:49
alex.barylski11-Oct-04 17:49 
GeneralRe: Working directory problem Pin
smbika12-Oct-04 1:54
smbika12-Oct-04 1:54 
GeneralRe: Working directory problem Pin
PJ Arends11-Oct-04 18:11
professionalPJ Arends11-Oct-04 18:11 
GeneralRe: Working directory problem Pin
smbika12-Oct-04 1:55
smbika12-Oct-04 1:55 
GeneralRe: Working directory problem Pin
BlackDice12-Oct-04 4:00
BlackDice12-Oct-04 4:00 
GeneralRe: Working directory problem Pin
smbika12-Oct-04 5:49
smbika12-Oct-04 5:49 

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.