Click here to Skip to main content
15,890,185 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with Vista... Pin
Mark Salsbery29-Jan-08 5:46
Mark Salsbery29-Jan-08 5:46 
GeneralCould any one tell... Pin
rowdy_vc++29-Jan-08 0:06
rowdy_vc++29-Jan-08 0:06 
GeneralRe: Could any one tell... Pin
CPallini29-Jan-08 0:49
mveCPallini29-Jan-08 0:49 
GeneralRe: Could any one tell... Pin
Maxwell Chen29-Jan-08 0:53
Maxwell Chen29-Jan-08 0:53 
GeneralThanks. Pin
CPallini29-Jan-08 0:58
mveCPallini29-Jan-08 0:58 
GeneralRe: Could any one tell... Pin
rowdy_vc++29-Jan-08 0:59
rowdy_vc++29-Jan-08 0:59 
GeneralRe: Could any one tell... Pin
Rajesh R Subramanian29-Jan-08 0:59
professionalRajesh R Subramanian29-Jan-08 0:59 
GeneralRe: Could any one tell... Pin
Rajesh R Subramanian29-Jan-08 21:28
professionalRajesh R Subramanian29-Jan-08 21:28 
Your situation demands line by line access to a file resource. Please use CStdioFile instead of CFile. Here's your solution, which can be used right away:
CStdioFile csf;
CFileException cfe;
CString str, sTemp;
CStringArray csa;
int iSize=0, iVer=0;


if ( !csf.Open(_T("E:\\Some.txt"), CFile::modeReadWrite, &cfe) )
    AfxMessageBox(_T("Failed to open the file"));

while(csf.ReadString(str))
{
    sTemp = str;
    str.Format(_T("%d. %s"), iVer+1, sTemp);
    csa.Add(str);
    ++iVer;
}

csf.SeekToBegin();
iSize = csa.GetSize();

for(int i=1; i<=iSize; ++i)
{
    sTemp.Format("%s\n", csa.GetAt(i-1));
    csf.WriteString(sTemp);
}
csf.Close();



Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP

QuestionVisual C++ and Ref counted std::string Pin
Giles29-Jan-08 0:01
Giles29-Jan-08 0:01 
GeneralRe: Visual C++ and Ref counted std::string Pin
led mike8-Feb-08 8:53
led mike8-Feb-08 8:53 
Generalstrange grammar about volatile and operator overload Pin
George_George28-Jan-08 23:47
George_George28-Jan-08 23:47 
AnswerRe: strange grammar about volatile and operator overload Pin
Rajkumar R29-Jan-08 1:45
Rajkumar R29-Jan-08 1:45 
GeneralRe: strange grammar about volatile and operator overload Pin
George_George29-Jan-08 14:09
George_George29-Jan-08 14:09 
AnswerRe: strange grammar about volatile and operator overload Pin
Rajkumar R29-Jan-08 17:46
Rajkumar R29-Jan-08 17:46 
GeneralRe: strange grammar about volatile and operator overload Pin
George_George29-Jan-08 18:11
George_George29-Jan-08 18:11 
GeneralRe: strange grammar about volatile and operator overload Pin
Maxwell Chen29-Jan-08 18:27
Maxwell Chen29-Jan-08 18:27 
AnswerRe: strange grammar about volatile and operator overload Pin
Rajkumar R29-Jan-08 19:08
Rajkumar R29-Jan-08 19:08 
GeneralRe: strange grammar about volatile and operator overload Pin
Maxwell Chen29-Jan-08 19:30
Maxwell Chen29-Jan-08 19:30 
GeneralRe: strange grammar about volatile and operator overload Pin
Rajkumar R29-Jan-08 19:37
Rajkumar R29-Jan-08 19:37 
GeneralRe: strange grammar about volatile and operator overload Pin
Maxwell Chen29-Jan-08 19:45
Maxwell Chen29-Jan-08 19:45 
GeneralShell Contet Menu Pin
john563228-Jan-08 23:45
john563228-Jan-08 23:45 
GeneralRe: Shell Contet Menu Pin
Iain Clarke, Warrior Programmer28-Jan-08 23:55
Iain Clarke, Warrior Programmer28-Jan-08 23:55 
QuestionHow to capture shutdown notification when Windows Shutdown Pin
Abhijit A28-Jan-08 23:37
Abhijit A28-Jan-08 23:37 
AnswerRe: How to capture shutdown notification when Windows Shutdown Pin
Maxwell Chen28-Jan-08 23:42
Maxwell Chen28-Jan-08 23:42 
GeneralRe: How to capture shutdown notification when Windows Shutdown Pin
Abhijit A29-Jan-08 0:37
Abhijit A29-Jan-08 0:37 

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.