I got this class
class CWebBrowser2 : public CWnd
And I want to override OnClose. What I have done so far, in the header file I have added void OnClose (); and in the .cpp file I added
void CWebBrowser2::OnClose ()
{
int i=0;
i++;
}
But OnClose is never called.
Then I tried changing the header file to
afx_msg void OnClose();
DECLARE_MESSAGE_MAP()
And added this to the .cpp file
BEGIN_MESSAGE_MAP(CWebBrowser2, CWnd)
ON_WM_CLOSE()
END_MESSAGE_MAP()
But still, OnClose is never called. I tried to switch to OnClose in OnDestroy, but this is not called either.
Any ideas on what I'm doing wrong?
source
share