Send message from subclassed ctrl to parent dlg? 
Author Message
 Send message from subclassed ctrl to parent dlg?

Hello all-

  Forgive me if this is a simple question- I'm relatively new to MFC and
windows programming.

  I subclassed CComboBox as "CKeyDropComboBox", and placed an instance
of it on my main dialog (of my wizard-generated dialog-based
application), called CComboTestDlg.  When a certain even happens on the
subclassed combo box, I would like a function to be called on the main
dlg.  If I understand the MSDN correctly, I should use a user message.
Where I've gotten stuck is on how to send the message, and how to set up
the handler on the dialog.

Here's how I'm sending from the subclassed combobox:
  GetParent()->SendMessage(KDCB_SELCHANGED, 0, 0);

I don't need to send any parameters just yet.  Is this the correct way?

I also gather that I need to use ON_MESSAGE in the message map and write
a handler, but these attempts have failed.

Does anyone have a simple example they'd be willing to share?

Korey Atterberry

Sent via http://www.*-*-*.com/
Before you buy.

Tue, 20 May 2003 10:41:36 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Send message from subclassed ctrl to parent dlg?

2. How to send NM_CLICK message to the parent

3. Sending a message to parent

4. PRB: List control doesn't send notification messages to CView parent

5. Sending a message to a parent CView from a child CWnd

6. Send message to parent

7. sending CTRL-TAB message

8. How to send CTRL+F9 message to the window

9. Subclassed Static Control Lose Its Parent Attribute

10. Notification to parent from Subclassed control

11. transparent text in a subclassed richedit ctrl

12. colors and subclassed treeview ctrl


Powered by phpBB® Forum Software