×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Estonia
    Posts
    350

    Exchanging data between client and server

    Hi!
    I want to exchange CBase class between client and server. Sending data from to server works OK:

    HBufC8* dataDes;
    TRAPD(r,dataDes=aData->MarshalDataL());
    if(dataDes)
    messageParameters[1] = static_cast<TAny*>( dataDes) ;
    TInt i=SendReceive( EMandelServRequestMandel, &messageParameters[0]);

    But when I try to get the modified data back from server then I
    get error code 2:

    HBufC8* desData=HBufC8::NewL(size*(sizeof(TInt32)+sizeof(TReal32))+sizeof(TInt32));
    TPtr8 readPtr(desData->Des());
    aMessage.ReadL(aMessage.Ptr1(),readPtr);
    iMandel= CMandelbrotData::NewLC(*desData); //I get my dataholder class initialized OK
    ...
    making some changes in data
    ....
    HBufC8* dataDes;
    TRAPD(r,dataDes=iMandel->MarshalDataL());
    if(dataDes)
    aMessage.WriteL(aMessage.Ptr1(),*dataDes); ///<--- gives error
    aMessage.Complete( KErrNone );

    I'm doing something stupid here. Can anyone show me the correct way?

  2. #2
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Estonia
    Posts
    350
    Sorry, the error I get is not 2, but KErrBadDescriptor .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×