Dear members:
I want to use the multithread in my program which is developed in
Visual C++ platform (version 6).
I created a controlling function:
UINT CCOMM1Dlg::WritingThreadFunc(LPVOID pParam) for a thread
The reason that I want it to belong to the class CCOMM1Dlg is that in
this function I need to process some member variables of the class.
The problem is that when I start the thread using:
int temp;
temp=1;
CWinThread* m_pWritingThread;
m_pWritingThread=AfxBeginThread(WritingThreadFunc, &temp);
The compiler shows the error:'AfxBeginThread':none of the 2 overloads
can convert parameter 1 from type 'unsigned int (void *)'
However, when I move the controlling function out of the class like
this:
UINT WritingThreadFunc(LPVOID pParam), no error appears.
Please help me to solve this problem, as I mentioned above, I need to
use the function in the class because it would process a lot of
member-variables of the class.
It is urgent to me, so please do help.
I look forward to your answers./
Thank you
LiuJU