Cannot capture XTPWM_PROPERTYGRID_NOTIFY
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=22352
Printed Date: 02 February 2025 at 5:54pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Cannot capture XTPWM_PROPERTYGRID_NOTIFY
Posted By: eam74
Subject: Cannot capture XTPWM_PROPERTYGRID_NOTIFY
Date 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
|
Replies:
Posted By: eam74
Date 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
|
Posted By: eam74
Date 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
|
|