×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    45

    How to create a tab or array of TDesC objects?

    Hi Folks,

    I want to store all the path name of files that I found in a directory using TFindFile::FindWildByDir().
    Using TParse::FullName(), I can get a TDesC cointaining the file path.

    I simply tried that:

    TDesC* pArray = new TDesC[iNbFiles];

    But the compiler does not agree...
    What can I use to store those TDesC objects to be able to extract the file pathname after?

    Thanks in advance,
    Seb.

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    128

    RE: How to create a tab or array of TDesC objects?

    Why not you use like this?
    CArrayPtrFlat<TDesC> *pArray = new(ELeave)CArrayPtrFlat<TDesC>(iNbFiles);
    for(int i=0; i<iNbFiles; i++)
    {
    pArray->AppendL(Pathi);
    }

    Then you can get the path just like this:
    TDesC *path = pArray->At(i);

    Hope this can help you.
    Any questions more, Please let me know.
    THX^_^

Posting Permissions

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