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
Solved

Message Handling

Posted on 2003-11-23
2
423 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 238
Delphi : could not find program, '...exe' 2 191
Printing problem 2 101
Delphi and Access based Enumeration 9 70
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 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