-
Step 1
Log on to codesource.net and download the MFC application "Multithreaded_Animation.zip." Save it to the desktop and unzip it. Open the "Animate.dsw" file.
-
Step 2
Create a thread for the application in MFC. Associate a message handler for the menu and toolbar.
-
Step 3
Use the AFxBeginThread. This is located in the command handler.
-
Step 4
Pass the address of the thread function. This is the function where the unit of code that will be executed is written.
-
Step 5
Surpass the HWND of the parent application window through the GetSafeHwnd(). From here pass the priority of the thread as "THREAD_PRIORITY_NORMAL. Control shifts in meeting this statement to the portion of code within this function.
-
Step 6
Type the following code: CWINthread *pthread1; pthread1=AfxBeginThread(Thread1,GetSafeHwnd(),THREAD_PRIORITY_NORMAL); UINT Thread1(LPVOID Ip) { Meassagebox(?Thread In Execution?); }. This represents Steps 2 through 5 consolidated into the actual code.
-
Step 7
Animate the functions using the MFC application. Here you can program the threads to work simultaneously.










