Handle any category of messages using Class Wizard
Posted
by Zafir Anjum
on October 1st, 2002
Here's what you can do to continue using the Class Wizard. At the top of your implementation file (cpp file) will the the message map which begins with a line like
BEGIN_MESSAGE_MAP(CMyListView, CListViewEx)Class Wizard uses the second argument in this macro to decide whether it needs to display more messages. Since class wizard doesn't recognize the CListViewEx class it does not show any of the list view control messages. What you can do is change the line to
#define CListView CListViewEx BEGIN_MESSAGE_MAP(CMyListView, CListView) #undef CListView
This will now allow you to add message handlers for the CListView class.
Thanks to Gert Rijs from Netherlands for suggesting the use of the #define directive. It fools the Class Wizard parser but provides the right code to the compiler.

Comments
using mpeg4 in VC++
Posted by Legacy on 03/16/2002 12:00amOriginally posted by: tarun
hi!
i would like to know how i could use VC++ to decode an mpeg4 input. if any body knows it please mail me at tar4ever@tatanova.com
ReplyWhat about VS.NET?
Posted by Legacy on 02/27/2002 12:00amOriginally posted by: Anatoly
Nice and helpful tip. Thanks a lot. Now I'm porting existing code to VC++.Net and noticed that the same approach doesn't work anymore. At least I couldn't map CPropertyPageEx derived calss messages using IDE's standard means (Control events).
Any ideas how to solve the problem?
Anatoly Smelkov
Replyanatoly@smelkov.com
Plz Help me
Posted by Legacy on 01/16/2002 12:00amOriginally posted by: Saheer
ReplyYou Must Read It..!!
Posted by Legacy on 12/13/2001 12:00amOriginally posted by: Renjith Pandalam
Sems to so better which help to keep some good manners and easiness whle programming with VC++.and i felt is so cool and comfortable.keep it up and good code
ReplyWRong in VC++
Posted by Legacy on 04/01/2001 12:00amOriginally posted by: AHAM
ReplyHAI
Posted by Legacy on 09/29/1999 12:00amOriginally posted by: I.R.L.REDDY
HELLO FRIEND,
IAM R.L.REDDY FROM HYDERABAD.IAM INTERESTED TO BECOME A PROFESSIONAL IN VC++.PLEASE GIVE ME YOUR VALUABLE SUGGESTIONS WHICH HELPS ME A LOT
YOURS FAITHFULLY
ReplyRAMALINGAREDDY
VISUAL SOFT(INDIA)PVT LIMITED
HYDERABAD.
Thanks
Posted by Legacy on 09/09/1999 12:00amOriginally posted by: Alexander
It's very usefull and buetefull!
ReplyThank you.
Be very careful
Posted by Legacy on 07/12/1999 12:00amOriginally posted by: Rod Ball
Although this trick will fool it into letting you add handlers (which is awesome by the way), if you have overridden any of the handlers in your base class, they will not be called as a result but, if you are careful you will catch it. For example, if in your base class you have overridden OnSetActive so you have CBaseClass::OnSetActive and then you define the macro
#define CPropertyPage CBaseClass
BEGIN_MESSAGE_MAP(CDerivedClass, CPropertyPage)
#undef CPropertyPage
and then you use class wizard to overrided it in the derived class you will get:
BOOL CDerivedClass::OnSetActive()
{
return CPropertyPage::OnSetActive();
}
and your call to the overridden OnSetActive() is completely lost because it calls the CPropertyPage's OnSetActive(). So, be careful and make sure you correct these or else you may get undesired results.
ReplyDocument, document, document
Posted by Legacy on 07/05/1999 12:00amOriginally posted by: John Killingbeck
Nice idea to solve a problem. A more thorough way to fool the system is to copy, then comment out, the original line and comment the reason for the change. That way the original can be easily restored if an upgrade bombs the trick. You want to fool the system, not your co-workers or yourself.
Replybug from MS
Posted by Legacy on 06/17/1999 12:00amOriginally posted by: chandra s s
ReplyLoading, Please Wait ...