Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BEGIN_MESSAGE_MAP and inheritance

517 views
Skip to first unread message

vjed...@atlas.cz

unread,
Apr 29, 2008, 6:49:45 AM4/29/08
to
Hello,

I have a class X inherited from CView and another class Y inherited
from X.

It seems BEGIN_MESSAGE_MAP does not work in both classes X and Y. Is
that a limitation of MFC or am I doing something wrong?

Thank you
Vaclav

David Wilkinson

unread,
Apr 29, 2008, 7:40:10 AM4/29/08
to

Vaclav:

It should work. In Y.cpp you must have

BEGIN_MESSAGE_MAP(Y, X)
// messages here
END_MESSAGE_MAP()

--
David Wilkinson
Visual C++ MVP

dert...@web.de

unread,
Apr 29, 2008, 9:29:41 AM4/29/08
to

Praise the Lord that Mr. Newcomer is off to some meeting, else you'd
have got a pretty sharp retort about how to do a proper error report
(of course, he'd be absolutely right about it, because you should at
the very least have posted an error message, better even a complete
minimal example).

Regards,
Stuart

Joseph M. Newcomer

unread,
Apr 29, 2008, 10:37:16 AM4/29/08
to
Actually, I've been back for over a week. And yes, the notion of "not work" was
ill-defined. Lack of code samples definitely makes it hard to analyze. David may have
already answered it.
joe

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

David Webber

unread,
Apr 29, 2008, 9:01:01 AM4/29/08
to

<vjed...@atlas.cz> wrote in message
news:fb8f0feb-0f95-4241...@y38g2000hsy.googlegroups.com...

It has been working fine for me for years - but note what David Wi.. says
about getting the inheritance right.

Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mozartists/mailinglist.htm

Vaclav

unread,
Apr 29, 2008, 1:30:17 PM4/29/08
to
There was no error message, the handlers just did not get called :)
Anyway, David was right. The superclass was not set correctly.
It is working now.

Thank you
Vaclav

<dert...@web.de> píse v diskusním príspevku
news:0d1daf14-0da8-42f4...@y21g2000hsf.googlegroups.com...

0 new messages