How Do You Make An MFC Worker Thread?
Threads are the objects that make multi-tasking possible. Threads, each corresponding to a “time slice” or separate state of the running program, create the illusion that multiple users can share a server application. The Microsoft Foundation Class Library encapsulates threads via the CWinThread class, which supports User and Worker threads that run in the background. In a few steps, you can make a simple program utilizing a Worker Thread. Start Microsoft Visual Studio. Create a dialog-based MFC project by clicking “File” from the upper menu and then “New.” After clicking the “Projects” tab, select “MFC AppWizard(exe)” and type “WThread” in the “Project name:” edit box. Click “OK.” In the next wizard screen, select “Dialog based,” then click “Finish” and “OK.” The wizard generates a default dialog box and its associated source files. Compile and run the application. When you click “OK,” a message box will appear stating that the background Worker thread has executed.