I'm creating a custom control class and since I want complete control of it, I register the class and want to use the class's
LRESULT CALLBACK OGLTOOLBAR::ToolProc(HWND, UINT, WPARAM, LPARAM)
but it's not letting me.
I'm doing:
HWND OGLTOOLBAR::create(HWND parent,HINSTANCE hInst, int *toolWidthPtr)
{
if (toolhWnd != NULL)
{
return toolhWnd;
}
toolWidth = toolWidthPtr;
ZeroMemory(&rwc,sizeof(rwc));
rwc.lpszClassName = TEXT("OGLTool");
rwc.hbrBackground = GetSysColorBrush(COLOR_BTNSHADOW);
rwc.lpfnWndProc = (WNDPROC)ToolProc;
rwc.hCursor = LoadCursor(0, IDC_ARROW);
RegisterClass(&rwc);
toolhWnd = CreateWindowEx(NULL, rwc.lpszClassName,NULL,
WS_CHILD | WS_VISIBLE,
0, 0, *toolWidth, 900, parent, 0, NULL, 0);
return toolhWnd;
}
what is the correct way of doing this?
Thanks
compiler says: Error 1 error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'WNDPROC'