Click to See Complete Forum and Search --> : CFile::Read


Tony Best
July 28th, 1999, 09:17 AM
I need to read from a file which has a line of data that looks like this.

AC1010 EasyCom-FM

The first part will get no larger than 7
and the largest for the sencond part is 30 but the send pard does contain whitespace. How do I do that?

I need to put the AC1010 in one string, and EasyCom-FM in another (They will be going into a 50x2 matrix.

this is my current code

void CTMACLoader32Dlg::OnProgramList()
{
CStringArray array2d[50][2]; //
char hold[50];
CString send;
GetDlgItem(IDC_Programs)->EnableWindow(TRUE);
CWnd::DlgDirList(dir, IDC_DirTree, 0, DDL_DIRECTORY);
ifstream infile; // declares file pointer named infile
m_file.Open("applist.txt",CFile::modeRead); // Opens appslist.txt
int rlcv,clcv;
for (rlcv=1; rlcv <= 40; rlcv++)
{
for(clcv=1; clcv <=2; clcv++)
{
m_file.Read(hold,25);
send = hold;
//array2d[rlcv][clcv] = send; // this needs to be a templated matrix class to work.
}
}
m_file.Close;
}

Please Help!
Tony