Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > My override function never gets called?

Reply
Thread Tools

My override function never gets called?

 
 
Angus Comber
Guest
Posts: n/a
 
      04-10-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)



 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      04-10-2004

"Angus Comber" <(E-Mail Removed)> wrote in message
news:4077e762$0$11661$(E-Mail Removed) ...
> 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


 
Reply With Quote
 
 
 
 
Angus Comber
Guest
Posts: n/a
 
      04-10-2004
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
(E-Mail Removed)



 
Reply With Quote
 
John Harrison
Guest
Posts: n/a
 
      04-10-2004

"Angus Comber" <(E-Mail Removed)> wrote in message
news:4077e9b4$0$95317$(E-Mail Removed) ...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You've never seen it before and you'll never see it again. Fred A Stover Computer Support 7 12-26-2007 03:33 AM
XML Schema never-never occurence of declared elements / attributes Soren Kuula XML 1 12-01-2005 01:27 PM
How override ALL function calls? (Is there a "function call function"?) seberino@spawar.navy.mil Python 2 08-01-2005 12:38 PM
My override function never gets called? - (reposting as mistake in first go) Angus Comber C++ 3 04-11-2004 07:39 AM
string routines go to never never land on unix Kevin C Programming 4 10-17-2003 06:07 PM



Advertisments