Making thread on MFC (example source code)

Simple source code

//Declaration
static UINT Thread(LPVOID pParam);


//Definition
UINT Thread(LPVOID pParam)
{
     //Thread Part 
     while( ((GUIView*)pParam)->Thread_B )
    {
        //Time delay
        Sleep(100);

        //Processing
        ((GUIView*)pParam)->DoProcessing(); 
      }

      return 0;
}


//Thread Begin 
void GUIView::BegainThread()
{
     Thread_B = true;
     ::AfxBeginThread(Thread, this);
}

Comments

Popular posts from this blog

OpenCV Stitching example (Stitcher class, Panorama)

(OpenCV Study) Background subtractor MOG, MOG2, GMG example source code (BackgroundSubtractorMOG, BackgroundSubtractorMOG2, BackgroundSubtractorGMG)

Example source code of extract HOG feature from images, save descriptor values to xml file, using opencv (using HOGDescriptor )

Real-time N camera stitching Class.

8 point algorithm (Matlab source code) / The method to get the Fundamental Matrix and the Essential matrix

Optical Flow sample source code using OpenCV

Video Stabilization example source code, (using cvFindHomography, cvWarpPerspective functions in openCV)

(OpenCV Study) calcOpticalFlowFarneback example source code ( dense optical flow )

yuv422(YUYV) to RGB and RGB to yuv422(YUYV), (Using OpenCV and TBB)

(C, C++) TinyXML , xml read & write