Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Cannot capture XTPWM_PROPERTYGRID_NOTIFY
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cannot capture XTPWM_PROPERTYGRID_NOTIFY

 Post Reply Post Reply
Author
Message
eam74 View Drop Down
Groupie
Groupie
Avatar

Joined: 18 June 2014
Location: USA
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote eam74 Quote  Post ReplyReply Direct Link To This Post Topic: Cannot capture XTPWM_PROPERTYGRID_NOTIFY
    Posted: 07 July 2014 at 2:30pm
As the title says, I am unable to capture any event from the property grid in my frame.  I have tried catching both in parent and child frame but the function is never called.

Here are the relevant parts of my code, let me know what else might help:

ChildFrame.h:

protected:
    afx_msg LRESULT OnGridNotify(WPARAM wParam, LPARAM lParam);
    DECLARE_MESSAGE_MAP()


ChildFrame.cpp:

IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)

BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
    ON_WM_CREATE()
    ON_MESSAGE(XTPWM_DOCKINGPANE_NOTIFY, OnDockingPaneNotify)
    ON_MESSAGE(XTPWM_PROPERTYGRID_NOTIFY, OnGridNotify) //IDR_PANE_PROPERTIES
END_MESSAGE_MAP()

...

    //in OnDockingPaneNotify:
    m_colPropertyGrid.Create(CRect(0,0,125,125), this, 0);

LRESULT CChildFrame::OnGridNotify(WPARAM wParam, LPARAM lParam)
{
    TRACE0("Property Grid Notify from CHILD FRAME\n");
    return 0;
}


I am able to capture the SendNotifyMessage in my derived class (ColPropertyGrid) but this is not where I want to catch the message.  I tried commenting it out thinking maybe that was blocking the message from being sent, but no difference.

I have been looking at the DrawClient sample for this but I can't figure out what I'm missing.  Any help would be appreciated.
Xtreme ToolkitPro (C++) v16.1.0, Windows 7
Back to Top
eam74 View Drop Down
Groupie
Groupie
Avatar

Joined: 18 June 2014
Location: USA
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote eam74 Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2014 at 3:12pm
looked at the MDIPanes Sample and tried adding a notify to that:

in ChildFrm.h added

protected:
afx_msg LRESULT OnGridNotify(WPARAM wParam, LPARAM lParam)
;

in ChildFrm.cpp added

    ON_MESSAGE(XTPWM_PROPERTYGRID_NOTIFY, OnGridNotify)

LRESULT CChildFrame::OnGridNotify(WPARAM wParam, LPARAM lParam) {
    TRACE0("GRID NOTIFY\n");
    return TRUE;
}

and it prints out the message as expected.  This seems to be precisely what I was doing... could it be that I am overriding something else that I shouldn't be??
Xtreme ToolkitPro (C++) v16.1.0, Windows 7
Back to Top
eam74 View Drop Down
Groupie
Groupie
Avatar

Joined: 18 June 2014
Location: USA
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote eam74 Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2014 at 3:28pm
Aha - the problem was in the OnDockingPaneNotify function instead.  I was missing the line

m_colPropertyGrid.SetOwner(this);

after calling Create.  I'm not sure why that doesn't  happen automatically given that you pass in a parameter for the parent window during Create, but it works now!
Xtreme ToolkitPro (C++) v16.1.0, Windows 7
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.