I'm trying to use thread lib within my class, the class basically just runs specific python function and stores it's return value, everything works fine however while waiting for the python function to finish my program freezes, so I decided to execute the script in a thread, however I'm getting this error:
error C2276: '&': illegal operation on bound member function expression
the code for the functions is below, execute is public function, the one an user is supposed to call, call function is private, called only by execute
> error C2276: '&': illegal operation on bound member function expression
std::thread is for normal functions only. There is one way around; you can use a normal function as a proxy and the proxy function will call whatever member function you need.
Function prototype : staticvoid call_proxy(bool make, PythonFunction *_this);
coder777's solution works, but my program still freezes when I call the function, I guess it's not enough to call the thread within a class and hope that the GUI will continue, right? any idea how should I implement this in a better way, so I can use my program while waiting for the function return? i'm using WinAPI, calling this within BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)