now i understand better how can resolve the problem
1 st - when we create the control, we must send the 'this' in last parameter:
Code:
hwnd = CreateWindowEx(0 , classname, strCaption.c_str(), WS_OVERLAPPEDWINDOW | WS_TABSTOP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, parent, NULL, hinstance, this);
2 nd - in window procedure we create the pointer variable:
Code:
form *inst = (form *)GetWindowLongPtr(HandleWindow, GWLP_USERDATA);
3 rd - we must use the WM_NCCREATE message:
Code:
case WM_NCCREATE:
{
CREATESTRUCT *p = (CREATESTRUCT *)lParam;
inst = (form *)p->lpCreateParams;
SetWindowLongPtr(HandleWindow, GWLP_USERDATA, (LONG_PTR)inst);
inst->hwnd = HandleWindow;
}
break;
now we can use the class members using the inst pointer
i hope these helps very people