|
Thanks CPallini,
Why virtual methods are not in the vtable? I think all virtual methods should be in vtable. What's wrong?
regards,
George
|
|
|
|
|
|
I am using VS 2008 under debug mode. Could you try my code in VS and check whether you could reproduce this issue? CPallini?
regards,
George
|
|
|
|
|
|
It is ok, CPallini. I just want to know your option about whether do you think foo and goo should be in vtable of Zoo?
regards,
George
|
|
|
|
|
I think they should. Anyway I have to admit my ignorance: I don't know what's happening (is it a debugger issue?)
I changed my mind about. See http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2729211[^]
Sorry for the chaos.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, September 18, 2008 6:40 AM
|
|
|
|
|
Sure, let me know when you have any ideas why foo and goo are not in vtable of class Zoo.
regards,
George
|
|
|
|
|
Sorry for changing my mind several times this morning.
Anyway, now, I think I was right the very first time: the Zoo class actually does NOT override foo & goo , hence such methods should not be inits VTABLE .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi CPallini,
I have tried even if we override foo and goo in class Zoo, in vtable of class Zoo, there is still no entries for foo/goo.
regards,
George
|
|
|
|
|
CPallini wrote: Why should foo & goo be in the VTABLE (I mean, no class overrides them)?
Yes, the Zoo class overrides them.
|
|
|
|
|
Thanks Cedric,
Sorry my English is not good. You mean foo and goo should be in vtable?
regards,
George
|
|
|
|
|
No, I was only replying to CPallini, not to you.
|
|
|
|
|
Thanks Cedric!
My careless. I want to confirm with you in the code link I posed below, you think foo and goo should be in vtable, correct?
http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2728926
regards,
George
|
|
|
|
|
I played a bit with your code and I think the problem is due to the "diamond pattern". I don't have a clear explanation of what is happening but if IFoo and IGoo inherits virtually from IBase, then the functions appear in the virtual table (in fact, looking with the debugger shows that a vtable has been added for IFoo and for IGoo).
|
|
|
|
|
Hi Cedric,
Virtual inheritance only makes one single copy of data member, and it has noting to do with methods, correct? But in my sample there is no data member. If I am wrong, please feel free to correct me.
regards,
George
|
|
|
|
|
Sure, I'me pretty blind this morning. Thank you for pointing out.
I changed my mind again (too many drugz this morning), see http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2729211[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Thursday, September 18, 2008 6:32 AM
|
|
|
|
|
Thanks CPallini,
Anyway, do you think foo and goo should be in vtable of Zoo?
regards,
George
|
|
|
|
|
Sorry, I naively acknowledged your observation, but it's (IMHO) wrong: actually Zoo class does NOT override foo & goo .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually, we are discussing this situation[^], in which Zoo overrides foo and goo .
|
|
|
|
|
You are correct, Cedric!
Do you have any ideas why foo and goo are not in class Zoo's vtable?
regards,
George
|
|
|
|
|
Please, don't reply each time when I make a reply to CPallini. This makes this thread completely unreadable. Furthermore, it would be nice to vote for the answers that were really helpfull, not all the answers (it helps other people to find directly the correct answer). I don't think the reply I made to CPallini was really helpfull to you...
George_George wrote: Do you have any ideas why foo and goo are not in class Zoo's vtable?
If I didn't reply to you, it probably means that I don't have the answer to your question, so, it won't help ask the question once again.
|
|
|
|
|
I agree with your points, Cedric! I will just wait for your reply.
regards,
George
|
|
|
|
|
I should give up with drugz
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
I have tried even if we override foo and goo in class Zoo, in vtable of class Zoo, there is still no entries for foo/goo.
regards,
George
|
|
|
|
|
Hi all,
I am building my application for windows VISTA using vc++ in which I need to execute it after restarting the machine.
At one point during my application is running I need to restart the system once and then again my application should run itself.
On the machine if Windows Defender is activated then it pops up a message for permission to run the exe. I do not need that pop up it should execute itself after restarting the machine.
Please suggest me the way to do this.
Thanks
|
|
|
|