• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 441
  • Last Modified:

Message Handling

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
hacibumbala
Asked:
hacibumbala
1 Solution
 
hzg115Commented:
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
 
hacibumbalaAuthor Commented:
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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now