that is why there is a function in that C code to
get the size of the buffer, that function is
part of the program that knows how to measure the
field of data.
you must also duplicate that function.
the SizeOf is simply returning the size of the
Created Object you have, it could be a simple
pointer, Integer, Etc..
Pointers require's 4 bytes of space to hold the
address value of where the pointer looks too!.
that is why your getting 4, because your doing a
compile time evaluation of that variable.
qnewpq wrote:
> This is the C++ code
> ====================
>
> ImageBuff = (uint8*)malloc(ATGetImageBufferSize());
> memset (&sEnrollResults, 0, sizeof(tsAT_ENROLL_RESULTS));
> sEnrollResults.uiStructureSize = sizeof( tsAT_ENROLL_RESULTS);
>
> Delphi Code
> ==========
> Reallocmem(pImageBuff,ATGetImageBufferSize);
> //e.g ATGetImageBufferSize returns 18090 so pImageBuff is sized to
18090.
> If I send sizeof(pImageBuff) I get 4. I want to measure the size of the
> allocated memory so that I can get 18090. Please assist am stuck!
>


|