|
that means can i assume that Virtual base class Contains one Vtable, And the Entire hierarchy contains one VTable.
Totally two VTables
|
|
|
|
|
No!
Each of the classes that are derived from the base class would have a vtable of their own
Suppose Base, Derived1, Derived2 would be the three classes. Derived1 and Derived2 are classes that are derived from the base class. Now in this case there would be 3 vtables. One for base. One for Derived1 and one for Derived2.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thabnkyou, for nice clarification, Can u suggest any links to further study About Vtables and Vptrs.
|
|
|
|
|
Here is an article that explains virtual functions. Try googling for some articles on VTABLES and VPTR's.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: Each of the classes that are derived from the base class would have a vtable of their own
I think, in case of single inheritance, all classes in heirarchy share same VTable .
|
|
|
|
|
prasad_som wrote: I think, in case of single inheritance, all classes in heirarchy share same VTable
AFAIK, the compiler creates a separate vtable for each class; adds a pointer to this vtable, called the virtual table pointer or vpointer, (often the first member) and generates hidden code in the constructor for each class to initialize its vpointer to the address of the corresponding vtable. There is one vtable for a class that contains a virtual function and a vtable associated to each of the class that are derived from the base class containing that virtual function.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
|
hello everyone. In a dialog based application, when i call a function in the initdialog()function, i get an error, saying-"Stack Overfolw". can anyone tell me what to do?? the same function works fine when run without the dialog box in a console. can anyone tell me what to do??
vijay
|
|
|
|
|
which function ? does it handle the dialog memory ?
|
|
|
|
|
Can you post some code? What about a call stack? We'll need more information...
Steve
|
|
|
|
|
Hello sir!! the code works when i increase the size of the stack, but is there any better way of making the code work?? yes, the function uses the dialog memory.Thanks...
vijay.
-- modified at 7:20 Monday 18th September, 2006
|
|
|
|
|
|
This obviously cannot be answered without seeing the code in question. Do you have any recursive calls? Do you have any very large stack-based variables?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
When running the .exe file I dont want the cmd window to pop up at all.
(c++ VS 2005)
Thank's
Moreno
|
|
|
|
|
|
Yes I tryed it but it's good when you want to run a console app from another project but my project is a console app and the cmd window pop's up when I start my exe file.
Moreno
|
|
|
|
|
u might have selected win32 console application as project type. Try taking a win32 project.
nave
|
|
|
|
|
Yes I did select win32 console app proj, and i want a console app project but without the cmd window can it be done?
I need it for a kind of autorun for running other app without poping itself up on the screen.
Moreno
|
|
|
|
|
I dont understand why u selected the console app proj.. any way try the following code
ShowWindow( GetConsoleWindow(), SW_HIDE );
nave
|
|
|
|
|
Because when I try win32 proj the proj window pops up - is ther's a way to hide this window?
Moreno
|
|
|
|
|
did ShowWindow( GetConsoleWindow(), SW_HIDE ); work for ur console application?
sir_moreno wrote: Because when I try win32 proj the proj window pops up -
I haven't seen a window like that.( i doubt u have take "hello word application" )
Take a "Win32 Application" then in the next option select "Simple application"( I am using VC6 now. so i dont know if this is same in vc2005 )
nave
|
|
|
|
|
The code didn't work I get an error.
but anyway even if it did this will be after the window pops up
In vs2005 after I choose win32 proj ther is no "Simple application".
Moreno
|
|
|
|
|
sir_moreno wrote: The code didn't work I get an error.
whats the error?
sir_moreno wrote: In vs2005 after I choose win32 proj ther is no "Simple application".
can u tell me what r the option under the win32 proj?
nave
|
|
|
|
|