473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1563

"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
by: Angus Comber | last post by:
Hello I have a base class a bit like this: class CTapiCall { // Constructor public: CTapiCall(); virtual ~CTapiCall();
6
by: Angus Comber | last post by:
Hello I have a base class a bit like this: class CTapiCall { // Constructor public: CTapiCall(); virtual ~CTapiCall();
2
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
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
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
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
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...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
2
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.