Using background threads for long processes in MFC: Foreground Thread 2

15 Apr 2003 11:42 mfc

We can deal with the first one (no feedback), by using an hourglass:

void CBgthreadDlg::OnForegroundHourglass()
{
    CWaitCursor wait;

    Task task(NULL);
    task.Run();
}

This certainly looks better. The user knows that the application is busy, so they’re less likely to think it’s gone wrong. It still doesn’t repaint properly, though.