M
Michael Geier
Hello,
suppose the following structure:
__gc struct dfheader
{
int var1;
int var2;
unsigned var3;
};
How can I determine the size of the structure during
runtime?
The sizeof-operator does'nt work with gc-classes.
I need the size, because I want to do this:
{
__gc struct dfheader* pDfheader=new __gc struct
dfheader();
pDfheader->var1=1;
pDfheader->var2=2;
pDfheader->var3=3;
dfheader __pin* pData=pDfheader;
BYTE* pByteData=static_cast<BYTE*>(pData);
for(int i=0;i<sizeof(__gc struct dfheader);i++)
// sizeof generate error
{
pFileStreamObject->WriteByte(pByteData);
}
}
Thanks in advance
Michael
suppose the following structure:
__gc struct dfheader
{
int var1;
int var2;
unsigned var3;
};
How can I determine the size of the structure during
runtime?
The sizeof-operator does'nt work with gc-classes.
I need the size, because I want to do this:
{
__gc struct dfheader* pDfheader=new __gc struct
dfheader();
pDfheader->var1=1;
pDfheader->var2=2;
pDfheader->var3=3;
dfheader __pin* pData=pDfheader;
BYTE* pByteData=static_cast<BYTE*>(pData);
for(int i=0;i<sizeof(__gc struct dfheader);i++)
// sizeof generate error
{
pFileStreamObject->WriteByte(pByteData);
}
}
Thanks in advance
Michael