ISSUE: How to create windows multi-threaded program in c++ ? SOLUTION: Now a day maximum project or software has multiple process running at a same process.Or a gui application needs to do some work on background which is blocking. Or may be you are going to design or create a network application ,so it becomes mandatory to be an expert of Threading now a days. Here is the template which I follow. In header file add the followings -- #include <Windows.h> static UINT __cdecl CallingFunctionForThread ( LPVOID pParam ); UINT WorkingFunction (); In CPP file add the followings -- UINT __cdecl My Class :: CallingFunctionForThread ( LPVOID pParam ) { My Class * pMy Class = reinterpret_cast < My Class *>( pParam ); UINT ret = pMy Class -> WorkingFunction (); return ret ; } UINT My Class :: WorkingFunction () { // You can do anything as a class member function and run it on your thread. } Start ...
Network programming and scalable micro-services in Azure