473,500 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My override function never gets called?

Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnCallStateIdle ()

In the CTapiCall class I see that OnInfoChange is called. However,
OnCallStateIdle never gets called in my CMainDlg class. What am I doing
wrong?

Angus Comber
an***@iteloffice.com

Jul 22 '05 #1
6 1629

"Angus Comber" <an***@NOiteloffice.com.PLEASENOSPAM> wrote in message
news:40***********************@mercury.nildram.net ...
Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnCallStateIdle ()

In the CTapiCall class I see that OnInfoChange is called. However,
OnCallStateIdle never gets called in my CMainDlg class.
Huh? Where did OnCallStateIdle suddenly come from?
What am I doing
wrong?


Very hard to say since you neglected to post either the definition of the
function that isn't being called, or the code that is doing the calling.

I'm not psychic, post again.

john
Jul 22 '05 #2

"Angus Comber" <an***@NOiteloffice.com.PLEASENOSPAM> wrote in message
news:40***********************@mercury.nildram.net ...
Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnCallStateIdle ()

In the CTapiCall class I see that OnInfoChange is called. However,
OnCallStateIdle never gets called in my CMainDlg class.
Huh? Where did OnCallStateIdle suddenly come from?
What am I doing
wrong?


Very hard to say since you neglected to post either the definition of the
function that isn't being called, or the code that is doing the calling.

I'm not psychic, post again.

john
Jul 22 '05 #3
Sorry - Here it is again:

Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnInfoChange (long InfoState);

In the CTapiCall class I see that OnInfoChange is called. However,
OnInfoChange never gets called in my CMainDlg class. What am I doing
wrong?

Angus Comber
an***@iteloffice.com

Jul 22 '05 #4
Sorry - Here it is again:

Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnInfoChange (long InfoState);

In the CTapiCall class I see that OnInfoChange is called. However,
OnInfoChange never gets called in my CMainDlg class. What am I doing
wrong?

Angus Comber
an***@iteloffice.com

Jul 22 '05 #5

"Angus Comber" <an***@NOiteloffice.com.PLEASENOSPAM> wrote in message
news:40***********************@mercury.nildram.net ...
Sorry - Here it is again:

Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnInfoChange (long InfoState);

In the CTapiCall class I see that OnInfoChange is called. However,
OnInfoChange never gets called in my CMainDlg class. What am I doing
wrong?


Sorry still don't get it. You are saying that the wrong function is being
called (or maybe no function at all, its not very clear). But you still have
not produced that code that calls the function, all the code you posted is a
few definitions, which doesn't help anyone.

What I want to see is something like this

void CSomeClass::some_function()
{
some_variable->OnInfoChange(123); /* here I want
CMainDlg::OnInfoChange to be called but it calls CTapiClass::OnInfoChange
instead */
}

If its more complex than that (I suspect it is) then I still need to see
*why* you expect CMainDlg::OnInfoChange to be called. You can't just post a
few perfectly valid definitions and say 'what am I doing wrong?'.

john
Jul 22 '05 #6

"Angus Comber" <an***@NOiteloffice.com.PLEASENOSPAM> wrote in message
news:40***********************@mercury.nildram.net ...
Sorry - Here it is again:

Hello

I have a base class a bit like this:

class CTapiCall
{
// Constructor
public:
CTapiCall();
virtual ~CTapiCall();

// Overridable methods for notifications
virtual void OnInfoChange (long InfoState);

// Etc
};
Then I inherit from this class:

class CMainDlg : public CDialogImpl<CMainDlg>, public CTapiCall

In CMainDlg I have this override function:

virtual void OnInfoChange (long InfoState);

In the CTapiCall class I see that OnInfoChange is called. However,
OnInfoChange never gets called in my CMainDlg class. What am I doing
wrong?


Sorry still don't get it. You are saying that the wrong function is being
called (or maybe no function at all, its not very clear). But you still have
not produced that code that calls the function, all the code you posted is a
few definitions, which doesn't help anyone.

What I want to see is something like this

void CSomeClass::some_function()
{
some_variable->OnInfoChange(123); /* here I want
CMainDlg::OnInfoChange to be called but it calls CTapiClass::OnInfoChange
instead */
}

If its more complex than that (I suspect it is) then I still need to see
*why* you expect CMainDlg::OnInfoChange to be called. You can't just post a
few perfectly valid definitions and say 'what am I doing wrong?'.

john
Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1563
by: Angus Comber | last post by:
Hello I have a base class a bit like this: class CTapiCall { // Constructor public: CTapiCall(); virtual ~CTapiCall();
6
1567
by: Angus Comber | last post by:
Hello I have a base class a bit like this: class CTapiCall { // Constructor public: CTapiCall(); virtual ~CTapiCall();
2
1316
by: Mark Essex | last post by:
I am trying to build an interface that requires the developer to use the OVERRIDE option. I looked at abstract classes, but seemed to have a couple of problems: 1. If you do this in a form, it...
3
5502
by: Tom Jones | last post by:
I do not understand what is meant when someone states that a given method is "hidden" verses overriden. Would someone please provide a short example of both cases and why you might want to...
1
2512
by: Craig | last post by:
I've tried to override the paint method and I can't get the overriden paint method to get called. I put the the method below within the class, but it never gets called when I open up my form. By...
15
3764
by: Cliff_Harker | last post by:
Why can't I do this in C# public class A { public A virtual whatever( A a ) { } } public class B : A
5
4511
by: Marcel Hug | last post by:
Hi NG ! I'm new in C# and I'm reading a book about the fundamentals and concepts. In the chapter Methods it's written to use virtual, if i would like to override the method in a subclass. This...
2
4343
by: Fredo | last post by:
I'm going to try to post this without having to paste in hundreds of lines of code. I'm trying to override IInternetSecurityManager. I'm taking sort of a minimalist approach and adding code as I...
2
3513
by: dolphin | last post by:
Hi everyone . I am confused about the different between override overload and hide. May be I have a wrong opinion, I always think that hide is very similar with override. Both of them call the...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.