SalSendClassMessage

forum.wishlist (1998-2005) & forum.gupta.wishlist (2005-2010)
User avatar
markus.essmayr
Site Admin
Site Admin
Austria
Posts: 1021
Joined: 06 Mar 2017, 06:07
Location: Austria

SalSendClassMessage

Post by markus.essmayr » 02 Jun 2004, 12:36

 Posted by:  Markus Eßmayr 

Currently, sending a message to a class is only possible, if the class has a
special action defined for it.

I would like to have the possibility, to send a message to a class, even if
there is no handler for it!

Why?
If you use a class library to develop your applications (and I'm sure that
most of you have that), you always have to take care about intercepting
messages on the window level and sending them to the windows' base class, if
there is another handler defined for it.
Now, what happens if you upgrade your class library and some classes now
also have important handlers for messages defined, that you also handle on
the window level? You'll have to walk through the whole application to find
those messages, and append the code for sending it to the base classes.

If it would be possible to use SendClassMessage, even in the class has no
handler for it, you could add those lines during development, and you don't
care about, if the base class uses it, or not.

Comments?

Matthias Körner

SalSendClassMessage

Post by Matthias Körner » 02 Jun 2004, 12:51

 Posted by:  Matthias Körner 

I support this wish!

Matthias Körner

Mirko
Italy
Posts: 1431
Joined: 04 Apr 2017, 08:56
Location: Geneva

SalSendClassMessage

Post by Mirko » 02 Jun 2004, 14:58

 Posted by:  Mirko BONANNO 

Hi Markus,

here is my comment ...

"...normally the class user is not supposed to know how the class is coded !

That's why a good class stucture should define messages intended to be used
in class actions, messages intended to be used in sub-class actions and
messages for istances (the class user).

Ex.:
Data Field Class: cdfSample
Functions
Function: OnSamClick
Function: OnPamClick
Function: OnAmClick
On SAM_Click
Call ..OnSamClick( )
Call SalSendMsg( hWndItem, PAM_Click, wParam, lParam )
On PAM_Click
Call ..OnPamClick( )
Call SalSendMsg( hWndItem, AM_Click, wParam, lParam )
On AM_Click
Call ..OnAmClick( )

In this example SAM_Click is used by the class programmer, PAM_Click is left
for an eventual sub-class programmer and AM_Click can be used by the
programmer . The programmer is not supposed to use SAM_* or PAM_* messages.
When you upgrade your class definition then the user will be informed (=
documentation) about the AM_* messages he can use !

That's how it should work in an ideally perfect OOP world (at least that's
how I understood it should work) ! "

Because we DO NOT work in a perfect OOP world I DO support your wish too ;-)

Ciao
Mirko

Thomas Lauzi

SalSendClassMessage

Post by Thomas Lauzi » 02 Jun 2004, 16:21

 Posted by:  Thomas Lauzi 

Yup, very important, i fully agree!!!!
It´s a potential trap and also I overloaded or inserted message handlers,
which I shouldn´t.
Another cool enhancemt would be a visual higlighting of overridden messages.
See attached picture...

PS: IntelliSAL shows you the base message. Dr. L from ITG also shows
dependencies, perhaps it is the right for you.

Thomas L.

Attachment: TD_MsgOverride.zip

Return to “gupta.wishlist”

Who is online

Users browsing this forum: [Ccbot] and 0 guests