一超过20行代码转为DELPHI。有高手帮助吗?
public unsafe int test(IntPtr phBmp)
{
if (IntPtr.Size = 4)
{
int* pBuffer = (int*)phBmp.ToPointer();
*pBuffer = hBmp.ToInt32();
phBmp = new IntPtr((void*)pBuffer);
}
else // 8-bytes, or 64-bit
{
long* pBuffer = (long*)phBmp.ToPointer();
*pBuffer = hBmp.ToInt64();
phBmp = new IntPtr((void*)pBuffer);
}
return NOERROR;
}
[解决办法]
Delphi的编译器暂时还未支持64位。
感觉这句代码有问题if (IntPtr.Size = 4)