Advertisement

02.25.2008 at 12:50PM PST, ID: 23191549
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Strange problem with SendMessage and ON_CONTROL

Asked by tmprog in Windows MFC Programming, Microsoft Programming, ActiveX

Tags:

Dear Experts

I'm trying to send my own message to parent window. So I defined message ID and put it into SendMessage function. In Parent window I put ON_CONTROL macro in message map, but it is never called. I use wrapper of ActiveX control (not MFC) and have no idea what is going wrong. I tried with wrapper around standard control (CComboBox) and it works fine. Is the any difference in calling WM_COMMAND for ActiveX wrappers and standard MFC controls?? What is very odd, It sometimes works if I put NULL instead of m_hWnd (as LPARAM) in SendMessage.

//command definition
#define SYSCOMBO_CHANGE 0x1000

//own ON_CONTROL definition
#define ON_SYSCOMBO_CHANGE(_id, _memberFxn) \
  ON_CONTROL(SYSCOMBO_CHANGE, _id, _memberFxn)

//method in which message is sent
void CSysComboEdit::OnItemChange()
{
  GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(), SYSCOMBO_CHANGE), (LPARAM)m_hWnd);
}

//how OnItemChange is called (maight be helpful)
BEGIN_EVENTSINK_MAP(CSysComboEdit, CSysEditBase<_dxPickEdit>)
  ON_EVENT_REFLECT(CSysComboEdit, 1 /* Change */, OnItemChange, VTS_NONE)
END_EVENTSINK_MAP()

//parent dialog message map
BEGIN_MESSAGE_MAP(CLoginDlg, CSysDialog)
      //{{AFX_MSG_MAP(CLoginDlg)
  ON_SYSCOMBO_CHANGE(IDC_TOOLS_COMBO_DATABASE, OnSelchangeComboDatabase)
      //}}AFX_MSG_MAP
      ON_WM_CTLCOLOR()
      ON_WM_ERASEBKGND()
END_MESSAGE_MAP()

//parent dialog method definition
afx_msg void OnSelchangeComboDatabase();

Method OnSelchangeComboDatabase is never called. I'm using VC6 with SP5.

Thank You for all answersStart Free Trial
[+][-]02.25.2008 at 08:30PM PST, ID: 20981616

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 11:56AM PST, ID: 20988083

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.04.2008 at 10:49AM PST, ID: 21043770

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Windows MFC Programming, Microsoft Programming, ActiveX
Tags: C++/MFC
Sign Up Now!
Solution Provided By: DanRollins
Participating Experts: 2
Solution Grade: B
 
 
[+][-]03.05.2008 at 12:09AM PST, ID: 21048560

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628