porting 8.1 to 9.x (ReadL)

Login to reply to this topic.
Wed, 2008-01-23 05:42
Joined: 2008-01-16
Forum posts: 8

hi all

i am porting the code written in 8.1 to 9.x

am facing problem in the below piece of code

TInt res;
const TAny* pD=Message().Ptr0();
TInt desLen=Message().Client().GetDesLength(pD);
HBufC8* writeBuf=HBufC8::New(desLen);
TPtr initptr = writeBuf->Des();
TRAP(res,Message().ReadL(pD,initptr));

I know the above api's has been depre Sad cated in 9.x

can u please let me know any alternative to implement the same..

thanks in advance

amjed


Wed, 2008-01-23 11:42
Joined: 2007-09-20
Forum posts: 95
Re: porting 8.1 to 9.x (ReadL)

The singnature of "ReadL" method is

void RMessagePtr2::ReadL(TInt aParam, TDes16 &aDes, TInt aOffset=0)

So instead specifying "pD" in ReadL, the index of the descriptor argument should be specified.

Inyour case index=0 (since reading first argument)

HBufC8* writeBuf=HBufC8::New(desLen);
TPtr initptr = writeBuf->Des();
TRAP(res,Message().ReadL(0,initptr));


Chao,
Raghav

  • Login to reply to this topic.