You should put the reading stuff inside a worker thread and signal to such thread the 'stop reading' condition from the GUI one (i.e. the main thread) setting a flag.
e.g.
if (readFile.Open(strFilePath, CFile::modeRead, &fileException))
{
while (readFile.ReadString(strLine) && stop_reading == false) { }
}