i have added following coe in my view class but still it’s not working.
BOOL CtestView::PreCreateWindow(CREATESTRUCT& cs)
{
if (CView::PreCreateWindow(cs))
{
WNDCLASS wc;
// Get the class information for the default MFC view class.
::GetClassInfo(AfxGetInstanceHandle(),cs.lpszClass,&wc);
// Register a new class using the attributes of the default
// view class, and make it the new default class.
cs.lpszClass = AfxRegisterWndClass(wc.style | CS_DBLCLKS,
wc.hCursor,wc.hbrBackground,wc.hIcon);
return TRUE;
}
return FALSE;
}
Is your window set to receive double click events? See this MSDN article. Quote:
You can also create your own double-clicks by managing up/down events, the delta between the cursor locations of those events and the time between them.
So for example, this sequence:
= double click
If in that sequence your timeout expires or the control changes you reset your counters and variables since the action was not a double click.