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

    how to enumerate files in the Mydocument in vista and windows 7

    hello,

    i have a client application running under the user Account. which retrieves the MyDocuments path through

    SHGetFolderPath( NULL, CSIDL_MYDOCUMENTS, NULL, 0, szPath );

    i am passing this path to my service that will enumerate the files in this folder. but i get access denied while doing this when i use FindFirst API.

    can someone please tell how could i fix this. i want to use LogOn APIs only as a last resort.
    can'nt i do it after applying some securities settings.

    regards
    d

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: how to enumerate files in the Mydocument in vista and windows 7

    Are you aware that....

    SHGetFolderPath Function
    Deprecated. Gets the path of a folder identified by a CSIDL value.

    Note As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderPath. The CSIDL value is translated to its associated KNOWNFOLDERID and then SHGetKnownFolderPath is called. New applications should use the known folder system rather than the older CSIDL system, which is supported only for backward compatibility.
    It appears that CSIDL_MYDOCUMENTS may not be supported in this implementation. Try using the equivalent FOLDERID_Documents with SHGetKnownFolderPath.
    Gort...Klaatu, Barada Nikto!

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