Error (activities) E0167 "DWORD (__stdcall CAAADlg: : *) (LPVOID pPram)" type of real participation "LPTHREAD_START_ROUTINE type parameter is not compatible with"
The above is the error message
Below is the header file statement
DWORD WINAPI th (LPVOID pPram);
The following is the function
DWORD WINAPI CAAADlg: : th (LPVOID pPram)
{
MessageBox (" aaaaaaaaa ");
return 0;
}
Here is where the problems
M_hListenThread=CreateThread (NULL, 0, th, this, 0, NULL);
CodePudding user response:
//XXXX. HCombined with the static
The class CAAADlg:
{
.
The static DWORD WINAPI th (LPVOID pPram);
.
};
CodePudding user response:
After add static statement variables prompt non-static member references must be as opposed to a particular object, how to solve this? Where to declare variables?CodePudding user response:
M_hListenThread=CreateThread (NULL, 0, th, this, 0, NULL);//passed thisDWORD WINAPI CAAADlg: : th (LPVOID pPram)
{
PThis CAAADlg *=(CAAADlg *) pParam;
//pThis - & gt; XXXXX
}
CodePudding user response:
Thread function must be defined in the class and the staticThe static DWORD WINAPI th (LPVOID pPram);
CodePudding user response: