void CGraphicPlotter1Dlg::ReadConfigFile() { CString sBuf; meStringArray ArrLine; int foundAt = ArrLine.Find(searchStr); int endAt = ArrLine.Find(searchStr); int unitAt; int unitEnd; int i; int imgNbr = 0; CString Seperator = _T("\t"); int Position = 0; CString Token; ReadFile("New Text Document.txt", ArrLine); int dwLength = ArrLine.GetSize(); searchStr = "UnitY-Name"; foundAt = ArrLine.Find(searchStr); if(foundAt != -1 ) { i = foundAt + 1; while( i < dwLength) { // Get Name of curves sBuf=ArrLine.GetAt(i); endAt = sBuf.Find("\t"); resultStr = sBuf.Mid(0,endAt); LPSTR curveName = resultStr.GetBuffer(); // Convert from CString to LPSTR //Token = sBuf.Tokenize(Seperator, Position); //while(!Token.IsEmpty()) //{ // Get next token. //Token = sBuf.Tokenize(Seperator, Position); //} // Get Units of curves unitAt = sBuf.Find(" "); unitEnd = sBuf.Find("\t",23); nextStr = sBuf.Mid(unitEnd,unitAt); lvItem.mask = LVIF_IMAGE | LVIF_TEXT; // Insert data into ListCtrl lvItem.mask = LVIF_IMAGE | LVIF_TEXT; lvItem.iItem = imgNbr; lvItem.iSubItem = 0; lvItem.pszText = curveName; lvItem.iImage = imgNbr; nItem = this->m_listTable.InsertItem(&lvItem); this->m_listTable.SetItemText(nItem, 1, nextStr); //this->m_listTable.SetItemText(nItem, 2, nextStr); //this->m_listTable.SetItemText(nItem, 3, nextStr); i++; imgNbr++; } } else { AfxMessageBox("No Curves Found!", MB_ICONEXCLAMATION); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)