I read the following article on www.go4expert.com
Worker Threads in MFC
Posted On 28th February, 2007
Prototype of AfxBeginThread Function
CWinThread* AfxBeginThread( AFX_THREADPROC pfnThreadProc,
LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL,
UINT nStackSize = 0, DWORD dwCreateFlags = 0,
LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL );
Body of Function
UINT MyThreadProc(LPVOID pParam)
if(pParam == NULL)
char *pStr = (char *) pParam;
*pStr++ ^= 0xA5;
I used the Above Given code it works Fine. But what if I want to use any control of my dialog in the function. It simply refuse to work as the following function is not member of the dialog class, hence it can not exploit any control of the dialog.
If I write this function as a member of my dialog class as follows.
UINT Myclass :: MyThreadProc(LPVOID pParam)
then the error occurs,
None of the 2 overloads can convert parameter1 to UINT(LPVOID).
Plz help me to write a function with the help of which i can use control(edit control/static control) of my dialog.
I simply want to display a counter's value in the edit control on the dialog.
and counter is being incremented in a loop in the function, that is to be used with AfxBeginThread.