×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    problem with _LIT

    Hi All,

    I have a file name in TPtr8 variable and I am using TFilename for
    file name manipulation. Now I can append it with a const Tdesc or a numeric value but can I append it with Tptr8 value ?

    or is there any way to assign TPtr8 value to Tdesc?

    Regards

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: problem with _LIT

    Can you show the code you are using, it might be easier to undersatnd what you are doing by seeing it..

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: problem with _LIT

    HBufC8* buffer = HBufC8::NewL( 8192 );
    TPtr8 ptr = buffer->Des();

    while(running)
    {
    User::WaitForRequest(status);
    ------
    ------
    blank.RecvOneOrMore(ptr, 0, status, dummyLength);
    _LIT(KDir,"c:\\data\\images\\");
    if(ptr.Find(Command) != KErrNotFound)
    {
    RFs fs ; User::LeaveIfError(fs.Connect()); CleanupClosePushL(fs);

    CDir* dirList;
    User::LeaveIfError(fs.GetDir(KDir, KEntryAttNormal ,ESortByName,dirList));

    }


    now i want to use ptr instead of KDir or any alternate solution?

    regards

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,698

    Re: problem with _LIT

    http://descriptors.blogspot.com may answer some questions of you.
    8 (TPtr8, HBufC8) and 16-bit (like TFileName, or HBufC - without '8') descriptors can not be swapped back and forth, but they can be copied to each other:
    Code:
    HBufC *temp=HBufC::NewLC(ptr->Length());
    temp->Des().Copy(ptr);
    User::LeaveIfError(fs.GetDir(*temp, KEntryAttNormal ,ESortByName,dirList));
    CleanupStack::PopAndDestroy(); // temp

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: problem with _LIT

    thx for the help.....but even this code results in compilation error "function call does not match".
    Last edited by kumar_a; 2008-11-15 at 06:10.

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: problem with _LIT

    its working now...thx

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

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