CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    19

    How to search for files in a directory and subdirectorie

    The following question is asked in regards to the following FAQ:


    I got an error on the following line of code:

    hFile = ::FindFirstFile(strPattern.c_str(), &FileInformation);
    Error 4 error C2664: 'FindFirstFileW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'

    I think it's a Unicode error but i don't know how to resolve it!!!
    Last edited by Andreas Masur; March 7th, 2009 at 11:42 AM.

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: How to search for files in a directory and subdirectorie

    The FAQ is not unicode-aware...thus in your case...you need to use 'std::wstring' instead of 'std::string'.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured