I want to use a thread to run a conversion process. This needs access the the main windows variables. Do I use AfxGetMainWnd() to do this?

What is the best way for an application to tell the thread to terminate?