Inheritance problem

Hi

I have created a new View based on CScrollView. Let us call this CMyScrollView.

From this new class I have created another view class which inherits from it e.g.

class CMyApplicationView : public CMyScrollView

Everything compiles fine but something is obviously wrong!

In CMyScrollView I deal with things like OnCreate, OnMouseMove, OnLButtonDown, OnSetCursor. However, these functions are never called i.e. I placed breakpoints there and they are never entered.

Can anybody tell me what I have done wrong?

As a matter of interest, some functions are called e.g. OnInitalUpdate is called.

Thanks in advance

John
IssacJonesAsked:
Who is Participating?
 
ZoppoConnect With a Mentor Commented:
Hi IssacJones,

maybe your view's message map is wrong - did you add these functions manaully or via ClassWizard or 'Add Event' or something?

Could you post the part of your view's file which starts with BEGIN_MESSAGE_MAP and ends with END_MESSAGE_MAP?

ZOPPO
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
How do you create the CMyApplicationView ?
0
 
IssacJonesAuthor Commented:
Yes, I'd forgotten to update the message maps in the child class so they called CMyScrollView
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.