I am trying to use callback to create a window that is a member function which has access to class members:
class A
{
public:
A();
LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};
A::A()
{
using namespace std::placeholders;
auto callback = std::bind(&A::WndProc, this, _1);
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, callback, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, _T("Example"), NULL };
}
error C2440: 'initializing': cannot convert from 'std::_Binder<std::_Unforced,LRESULT (__cdecl A::* )(HWND,UINT,WPARAM,LPARAM),A *,const std::_Ph<1> &>' to 'WNDPROC'
I do not understand what is wrong here, Im trying to do it from examples from similar questions, but I think I do not really understand what is happening here