Solved

Message Handling

Posted on 2003-11-23
2
427 Views
Last Modified: 2012-05-04
Hi All!

I am trying to convert a custom control written in C++ to Delphi. I do not have much C++ background. Can anybody tell me how to convert the below code to Delphi:

BEGIN_MESSAGE_MAP(CSomeClassEx, CSomeClass)
  ON_NOTIFY_REFLECT(A Notification, A Handler)
END_MESSAGE_MAP()

To handle messages received by the control I normally override WndProc method, but this notification is received by the Parent window of the control through WM_NOTIFY message. What is the best way to convert this code?

Thanks in advance...
0
Comment
Question by:hacibumbala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
hzg115 earned 125 total points
ID: 9808761
see the VCL source code

WMNotify(var Message: TWMNotify); message WM_NOTIFY;

procedure TWinControl.WMNotify(var Message: TWMNotify);
begin
  if not DoControlMsg(Message.NMHdr^.hWndFrom, Message) then inherited;
end;
0
 
LVL 1

Author Comment

by:hacibumbala
ID: 9820206
I checked the VCL code and realized that correct declaration should be:

procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY;

However, your information helped a lot. Thank you for the answer!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question