Mouse action not detect @ all.
Hi I created a class as follows and try to inherit from CWnd:
class CGLWinTarget : public CWnd
{
public:
CGLWinTarget(CWnd *pParent=NULL); // standard constructor
~CGLWinTarget();
void CreateNewWin();
.....
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT
nID,
CCreateContext* pContext = NULL);
DECLARE_MESSAGE_MAP()
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
};
And I created another class, CTester that inherits from CGLWinTarget...
as to why I am doing this is because CGLWinTarget will include some
methods that are "FIXED".
So at class CTester, I have the following code for the create method
that calls the create method of the parent class:
void GLViewer::Create(int x, int y, int w, int h, void *father)
//should passin parameter
{
if(m_created==0) {
if(CGLWinTarget::Create(_T("STATIC"),NULL,WS_CHILD|WS_VISIBLE,CRect(x,y,w,h),
(CWnd *) father,0)) {
CDC *m_pDC = this->GetDC();
.....
}
}
}
But not sure as to why I cant access the mouse action... any clues??
thanks
Any help is greatly appreciated.
Cheers.