size_t is a plaform and architecture specific type ... using UInt32 might not be correct e.g. for 64-bit. The real problem is this part tho: GetMem(LUserEntity, pCount);
It has to be GetMem(LUserEntity, pCount * SizeOf(UserEntity));
Thank you Zacherl , I've fixed the issue by using string fixed length in both C++ and Delphi , and using the
UIntPtr instead of
UInt32
Again thank you .