Hi! this is the complete code which i hav done untill now
Code:Void sendtext() { CTreeCtrl& trCtrl = GetTreeCtrl(); HTREEITEM hItem,hsc; CExerciseDoc *pDoc = GetDocument(); CString pathname,strLine; CString filename; CFileDialog dlg(TRUE); dlg.DoModal(); if(dlg.DoModal() == IDOK) { pathname=dlg.GetPathName(); // return full path and filename } CStdioFile File; if(File.Open(pathname, CFile::modeRead)) // Open file to be read { while(File.ReadString(strLine)) // Read file { int Position = 0; CString Token; CAtlString str(strLine); CAtlString resToken,resToken1; resToken = str.Tokenize(_T("-:, "), Position); //A,B pDoc->pSendview->displaytext(resToken); if(resToken != (_T(""))) // Empty File Check hItem = trCtrl.InsertItem(resToken , 0, 2 ); while(resToken!="") { resToken = str.Tokenize(_T("-:@, "), Position); } } } } } void CRightView::displaytext(CAtlString league) { CListCtrl &ctlRightView = this->GetListCtrl(); ResetLeagues(); CAtlString resToken; ctlRightView.InsertColumn(1, _T("First "), LVCFMT_LEFT, 80); ctlRightView.InsertColumn(1, _T("Second "), LVCFMT_LEFT, 80); int nItem; nItem = ctlRightView.InsertItem(0, league); ctlRightView.SetItemText(nItem, 1, league); }




Reply With Quote
