×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    4

    Post Problem in converting QString to TDesC8

    Hello everyone,,

    I got problem with converting QString to TDesC8

    this is my block-code:

    QString key = "abcdef0123456789";
    TPtrC8 dataPtrKey(reinterpret_cast<const TUint8*>(key.toUtf8().constData()));
    TBufC8 *iKey = HBufC8::NewLC(dataPtrKey.Length());
    iKey->Des().Copy(dataPtrKey);

    Compiling process was success.
    But, when I open my program in Symbian Emulator and entering that block-code, my program was exit.

    What's wrong with my code?

    thanks before,,

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    4

    Re: Problem in converting QString to TDesC8

    OK,,
    Finally I can solve this problem.

    QString key= "abcdef0123456789";
    TBuf<16> initialVector(key.utf16());
    TBuf8<16> iKey;
    iKey.Copy(initialVector);
    Last edited by shaftamuslim; 2011-02-07 at 09:12.

Similar Threads

  1. Converting qreal to qstring
    By Nujabrn in forum Qt
    Replies: 6
    Last Post: 2010-12-15, 12:21
  2. exception occurs when converting QString to std::string
    By kimitake in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2010-04-29, 17:08
  3. Converting TUint32 to TDesC8
    By j1978 in forum Symbian
    Replies: 5
    Last Post: 2003-07-31, 18:10
  4. Converting TPtr16 to TDesC8
    By -Charles_Weir- in forum Symbian
    Replies: 3
    Last Post: 2002-02-16, 16:33

Posting Permissions

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