Thread: Mapping WM_LBUTTONDOWN in a CFrameWnd derived class

  1. #1
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226

    Question Mapping WM_LBUTTONDOWN in a CFrameWnd derived class

    Hi all,

    I am using VC++ 6.0.

    I am creating a simple "MFC AppWizard" based SDI application....and using ClassWizard to map WM_LBUTTONDOWN in the CMainFrame class. Thus Class Wizard creates an OnLButtonDown function....

    However, this function never get called???? I placed a TRACE statement and it never gets executed. On the other hand, if I create the OnLButtonDown function in the CView derived class....it gets called without any problems.

    Thanks in advance.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Windows question. Moved.


    The CView-derived window covers the entire area of the CMainFrame window, except for the borders and stuff ("non-client" areas) which don't report LBUTTONDOWN. Therefore, CMainFrame never gets clicks.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Two conceptual questions
    By AntiScience in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2007, 11:36 AM
  2. derived class can not access base class protected member?
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 10-21-2007, 06:32 PM
  3. Calling constructor of the base class of a derived class..
    By CaptainPenguin in forum C++ Programming
    Replies: 5
    Last Post: 02-19-2003, 01:47 PM
  4. Replies: 4
    Last Post: 12-29-2002, 12:29 AM
  5. Troubles overriding a const in a derived class
    By sh0x in forum C++ Programming
    Replies: 5
    Last Post: 10-05-2001, 07:11 PM