Questions tagged [message-map]
15 questions
5
votes
1 answer
How do ATL/WTL alternative message maps (ALT_MSG_MAPs) work? When do I use them?
I've read the documentation, which says:
ATL supports alternate message maps, declared with the ALT_MSG_MAP macro.
Each alternate message map is identified by a unique number, which you pass to ALT_MSG_MAP.
Using alternate message maps, you can…

user541686
- 205,094
- 128
- 528
- 886
3
votes
1 answer
MFC: Expanding during runtime
I have a GUI project at work that uses MFC.
The widgets (controls) have message processing in a compile-time message map table.
I want to conditionally add controls to the form during runtime, but I'm stuck on how to append message handlers to…

Thomas Matthews
- 56,849
- 17
- 98
- 154
3
votes
1 answer
Menu item keeps disabled even after ON_COMMAND handler is added
I've made a simple split-window application using Visual Studio 2013. There are two views, one view is made of default-view-class and the other view is made of custom-view-class derived from CScrollView.
/////////////////////////
//…

Walter.JJ
- 31
- 1
- 5
2
votes
1 answer
MFC: Have CDockablePane receive ON_NOTIFY_REFLECT messages for a CTreeCtrl?
The MFC Wizard created a project with a CWorkSpaceBar which in my case is actually based on CBCGPDockingControlBar, the MFC equivalent is CDockablePane. The wizard also created a m_wndTree based on CBCGPTreeCtrl (CTreeCtrl). It created it in its…

user3161924
- 1,849
- 18
- 33
2
votes
1 answer
How to Extract Information from Protobuf MessageMap (Python)
I have a MessageMap object (in Python) and I can't for the life of me figure out how to properly extract the information I need:
MessageMap object:
outputs {
key: "outputs"
value {
dtype: DT_FLOAT
tensor_shape {
dim {
…

Dylan Randle
- 271
- 2
- 10
1
vote
1 answer
Abstracting ID on message map based on class hierarchy
I have a hierarchy of classes one base B, several derived D from B.
There is a protected member m_treeID, which is the ID of each tree inside.
I want at the base class to fill the message map like
ON_NOTIFY(NM_CLICK, m_treeID,…

sergiol
- 4,122
- 4
- 47
- 81
1
vote
1 answer
Close a dialog on clicking CANCEL button ignoring EN_KILLFOCUS
I have a CEdit field in my dialog where I have implemented EN_KILLFOCUS, so when the user enters invalid data a warning message is displayed when the focus moves away from this field and the focus returns to the CEdit field so that the user can…

Tansheet Izhad
- 103
- 2
- 3
- 10
1
vote
0 answers
MFC - How to execute a certain method whenever a property is changed
A few days ago I've started to develop a MFC Application which works as a Client for a database of mine. Lately, I was trying to implement a method which is executed every time a property value is changed (preferably a field which works as a…

Mudkip
- 373
- 6
- 27
1
vote
1 answer
Catching and redirecting ON_UPDATE_COMMAND_UI Messages
I have a CMDIChildWnd containing a CReportView (child) within a CFormView (parent). The CMDIChildWnd also has a toolbar which sends ON_UPDATE_COMMAND_UI to it's child view. That works so far. Now, whenever the CReportView is activated (e.g. clicking…

koloman
- 711
- 7
- 19
1
vote
2 answers
How to pass value to MFC message map function on_command
I have a function that performs a specific action depending on the std::string value it receives.
Eg:
void performTaskOnStringValue(std::string);
Now I have a set of Ribbon Buttons (CMFCRibbonButton) that need to call this function by passing…

Eternal Learner
- 3,800
- 13
- 48
- 78
0
votes
1 answer
Catching windows shutdown events using AFX Message maps, handler function is never called
I have a windows c++ app that I want to gracefully shutdown. Doing my research seems like QueryEndSession EndSession and Powerbroadcast would be the windows events of interest.
So I plugged them into my message map like this
…

ldyaxqcy
- 29
- 4
0
votes
1 answer
How to determine the HWND in an ATL message map with contained windows
Let's say you're creating an ATL CWindowImpl class with one or more CContainedWindows. And then let's say you want to chain some of the CContainedWindows' ALT_MSG_MAPs so that a couple windows share some base functionality in their window…
user14128415
0
votes
2 answers
Does exist a ON_COMMAND_EX version accepting a function returning void?
I searched but I didn't found. I want a Message map macro that links the menu item command action to a function accepting the numeric ID and providing no return at all (being void).
ON_COMMAND returns void, but it is too limited, because it does not…

sergiol
- 4,122
- 4
- 47
- 81
0
votes
1 answer
c++ MFC and handling windows Messages
What code is needed in the message map for Windows messages?
The code calling the function:
SendMessage(GRID_WM_UPDATECELL,(WPARAM)1,(LPARAM)&sDisp);
The function:
LRESULT CNJAGridCtrl::OnUpdateCell(WPARAM wParam, LPARAM lParam)
{
}

Jak
- 471
- 5
- 20
0
votes
1 answer
MFC catch Control's Message of child from parent without create class handler for child?
I have a CDialog created by wizard named CDialogParent, then create a child dialog template has IDD= IDD_CHILD_DLG1, in this child dialog I put one button IDC_BTN1 (I don't create class handler for this child).
BOOL CDialogParent::OnInitDialog()
{
…

user1742892
- 21
- 4