TPtr的长度问题???
iTmpBuffer = HBufC8::NewL(8);
iPtrOfTmpBuffer.Set(iTmpBuffer->Des());
TInt len = iPtrOfTmpBuffer.MaxLength(); //len = 12,奇怪,应该是 8 啊
大家帮我看看这几行代码
让我困惑的是我这里的 TmpBuffer明明是分配了 8 个长度的内存
为什么我的 len 值却是 12
SDK help 中关于 HBucC8 的 Des() 函数有这么一段说明,不知道什么意思,会不会跟我的这个错误有关——
The maximum length of the modifiable pointer descriptor is set to the length of the heap descriptor's buffer. Note that the maximum length is the length of the descriptor buffer in the allocated host heap cell; this may be greater than the maximum length requested when this descriptor was originally created or last re-allocated.