Click here to Skip to main content
15,897,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionCListCtrl with tool tip to have multiple lines Pin
Kyle P29-May-06 16:05
Kyle P29-May-06 16:05 
AnswerRe: CListCtrl with tool tip to have multiple lines [modified] Pin
bob1697229-May-06 17:52
bob1697229-May-06 17:52 
GeneralRe: CListCtrl with tool tip to have multiple lines [modified] Pin
Sarath C29-May-06 18:30
Sarath C29-May-06 18:30 
GeneralRe: CListCtrl with tool tip to have multiple lines [modified] Pin
bob1697229-May-06 19:01
bob1697229-May-06 19:01 
GeneralRe: CListCtrl with tool tip to have multiple lines [modified] Pin
Sarath C29-May-06 20:28
Sarath C29-May-06 20:28 
QuestionCheck box + OnTimer problem Pin
Immunity1829-May-06 13:03
Immunity1829-May-06 13:03 
AnswerRe: Check box + OnTimer problem Pin
_anil_29-May-06 14:10
_anil_29-May-06 14:10 
GeneralRe: Check box + OnTimer problem Pin
nsh_enp29-May-06 15:18
nsh_enp29-May-06 15:18 
AnswerRe: Check box + OnTimer problem Pin
ThatsAlok30-May-06 1:36
ThatsAlok30-May-06 1:36 
QuestionRich Edit View Quick Question [modified] Pin
BlitzPackage29-May-06 11:23
BlitzPackage29-May-06 11:23 
AnswerRe: Rich Edit View Quick Question [modified] Pin
G Haranadh29-May-06 19:02
G Haranadh29-May-06 19:02 
QuestionIXMLDOMDocument::loadXml question Pin
YaronNir29-May-06 10:59
YaronNir29-May-06 10:59 
AnswerRe: IXMLDOMDocument::loadXml question [modified] Pin
_anil_29-May-06 14:21
_anil_29-May-06 14:21 
GeneralRe: IXMLDOMDocument::loadXml question [modified] Pin
YaronNir29-May-06 20:02
YaronNir29-May-06 20:02 
GeneralRe: IXMLDOMDocument::loadXml question [modified] Pin
_anil_29-May-06 20:07
_anil_29-May-06 20:07 

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.