D
debadeepti
Hi All,
I am porting an application from watcom to vc compiler. In watcom and
other compiler (other then vc) memory allocation of __vfptr inside
class object are different. In vc __vfptr is allocated top of the class
object i.e base address of class objects are same as __vfptr address.
But in watcom compiler __vfptr is allocated end of the class object.
Due to this difference, I am getting problem in accessing the member
variable address correctly. Is there any way in vc compiler option to
bring __vfptr from top to bottom of the class object.
Let's take a class example
Class exp_v
{
virtual void foo(void) {};
private:
int a;
int b;
};
In Watcom:-
|-----------------|<-- 0x3660(BaseAddress)
|int a |
|-----------------|<-- 0x3664
|int b |
|-----------------|<-- 0x3668
|__vfptr |
|-----------------|
In VC++.NET:-
|-----------------|<-- 0x3660(BaseAddress)
|__vfptr |
|-----------------|<-- 0x3664
|int a |
|-----------------|<-- 0x3668
|int b |
|-----------------|
Thanks & Regards
Debadeepti Sahu.
I am porting an application from watcom to vc compiler. In watcom and
other compiler (other then vc) memory allocation of __vfptr inside
class object are different. In vc __vfptr is allocated top of the class
object i.e base address of class objects are same as __vfptr address.
But in watcom compiler __vfptr is allocated end of the class object.
Due to this difference, I am getting problem in accessing the member
variable address correctly. Is there any way in vc compiler option to
bring __vfptr from top to bottom of the class object.
Let's take a class example
Class exp_v
{
virtual void foo(void) {};
private:
int a;
int b;
};
In Watcom:-
|-----------------|<-- 0x3660(BaseAddress)
|int a |
|-----------------|<-- 0x3664
|int b |
|-----------------|<-- 0x3668
|__vfptr |
|-----------------|
In VC++.NET:-
|-----------------|<-- 0x3660(BaseAddress)
|__vfptr |
|-----------------|<-- 0x3664
|int a |
|-----------------|<-- 0x3668
|int b |
|-----------------|
Thanks & Regards
Debadeepti Sahu.