×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    9

    How to convert a TBuf<n> variable to TDes&?

    How to convert a TBuf<n> variable to TDes&?

  2. #2
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    169

    How to convert a TBuf<n> variable to TDes&?

    Hey,

    a Tbuf<n> already is a TDes. The problem you are probably having is not passing the TBuf by reference (as the & operator implies). If you do it like this it ashould be OK:

    TBuf<20> my TBuf;
    ret=MyFunction(myTBuf);

    In some cases though you need to explicitly cast it to TDes& type, bY passing it as (TDes&) myTBuf, so the above code would change to:

    TBuf<20> my TBuf;
    ret=MyFunction( (TDes&) myTBuf);

    Then it should work.

    Regards, Aljaz

Posting Permissions

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