Solved

Message Handling

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now