Click here to Skip to main content
15,908,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Message Deleted] Pin
_kal_29-May-06 21:25
_kal_29-May-06 21:25 
AnswerRe: Moving Caret using SetCaretPos Pin
G Haranadh29-May-06 23:08
G Haranadh29-May-06 23:08 
GeneralRe: Moving Caret using SetCaretPos Pin
G Haranadh30-May-06 0:41
G Haranadh30-May-06 0:41 
AnswerRe: Moving Caret using SetCaretPos Pin
ThatsAlok30-May-06 1:50
ThatsAlok30-May-06 1:50 
QuestionProblem with spliltter window Pin
sahaja_p29-May-06 21:15
sahaja_p29-May-06 21:15 
AnswerRe: Problem with spliltter window Pin
Ganesh_T29-May-06 22:25
Ganesh_T29-May-06 22:25 
AnswerRe: Problem with spliltter window Pin
NiceNaidu30-May-06 0:34
NiceNaidu30-May-06 0:34 
QuestionCapturing cprintf Pin
eku29-May-06 20:58
eku29-May-06 20:58 
AnswerRe: Capturing cprintf [modified] Pin
toxcct29-May-06 21:28
toxcct29-May-06 21:28 
GeneralRe: Capturing cprintf Pin
kakan29-May-06 23:14
professionalkakan29-May-06 23:14 
GeneralRe: Capturing cprintf Pin
toxcct29-May-06 23:16
toxcct29-May-06 23:16 
GeneralRe: Capturing cprintf [modified] Pin
eku30-May-06 8:14
eku30-May-06 8:14 
QuestionList box Issue Pin
itkid29-May-06 20:22
itkid29-May-06 20:22 
AnswerRe: List box Issue Pin
_AnsHUMAN_ 29-May-06 20:30
_AnsHUMAN_ 29-May-06 20:30 
GeneralRe: List box Issue Pin
itkid29-May-06 21:06
itkid29-May-06 21:06 
GeneralRe: List box Issue Pin
_AnsHUMAN_ 29-May-06 22:02
_AnsHUMAN_ 29-May-06 22:02 
AnswerRe: List box Issue Pin
Hamid_RT29-May-06 20:30
Hamid_RT29-May-06 20:30 
AnswerRe: List box Issue Pin
Sarath C29-May-06 20:43
Sarath C29-May-06 20:43 
AnswerRe: List box Issue Pin
Member 303984329-May-06 22:55
Member 303984329-May-06 22:55 
QuestionGot problem with reading files Pin
Immunity1829-May-06 18:42
Immunity1829-May-06 18:42 
AnswerRe: Got problem with reading files Pin
bob1697229-May-06 19:27
bob1697229-May-06 19:27 
GeneralRe: Got problem with reading files Pin
Immunity1829-May-06 19:30
Immunity1829-May-06 19:30 
GeneralRe: Got problem with reading files [modified] Pin
bob1697229-May-06 19:41
bob1697229-May-06 19:41 
call these two functions like so (adjust the filepath)... (This appears to work)
PerformTask();
PerformTask2();


void CTestfileDlg::PerformTask()
{
CString sFilePath="c:\\temp\\list.txt";
CStdioFile file;
CString sOutput="0000000000111111111122222222223333333333444444444455";
int nCount=sOutput.GetLength();

try {

if (file.Open(sFilePath,CFile::modeReadWrite|CFile::modeCreate)) {

for (int i=0;i<nCount;i+=10) {
file.WriteString(sOutput.Mid(i,10)+"\r\n"); // Append text
}
file.Close();
}
}

catch (CException * e) {

e->ReportError(); // Popup description of exception
e->Delete(); // Clean up.
}

catch (...) { // Catch any other exceptions
AfxMessageBox("Failed to open file!");
}
}

void CTestfileDlg::PerformTask2()
{
const int sz=100;
char buf[sz];
CString LString;
m_AListCtrl.ResetContent();
CString Filename = "C:\\temp\\list.txt";

ifstream ListFile( Filename );
while( ListFile.get ( buf,sz ) )
{
ListFile.get();
LString = (LPCSTR)buf;
m_AListCtrl.AddString(LString);
}
}

-- modified at 1:41 Tuesday 30th May, 2006
GeneralRe: Got problem with reading files [modified] Pin
Immunity1829-May-06 19:49
Immunity1829-May-06 19:49 
GeneralRe: Got problem with reading files Pin
Immunity1829-May-06 19:40
Immunity1829-May-06 19:40 

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.