|
Question (1) In a program of a member function of a class, I have the following statement:
h [0] = (HANDLE) :: _ beginthreadex (NULL, 0, bank_allocation, NULL, 0,&uld);
Where bank_allocation is the name of another member function in the class, which is declared as follows:
UINT __stdcall Cresource :: bank_allocation (LPVOID lpParam);
The compilation error (the error location is where beginThreadex () is used above), the prompt is as follows:
G:\resource\resource.cpp (100): error C2664: '_beginthreadex': cannot convert parameter 3 from 'unsigned int (void *)' to 'unsigned int (__stdcall *) (void *)'
None of the functions with this name in scope match the target type
The reason for the error is the wrong parameter type. I can't figure it out. I have declared the type of the bank_allocation () function as UINT __stdcall.
(2) How to use beginThreadex to pass parameters to the new thread? For example, to pass an integer variable |
|