在Create一个Long Path Folder时,当Folder名过长时,会无法创建或者创建后无法使用。请问当知道一个Long Path Folder Name时,如何判断这个Folder能不能Create,而且不会Create一个不能用的文件夹?

解决方案 »

  1.   

    lpPathName 
    [in] Pointer to a null-terminated string that specifies the path of the directory to be created. 
    There is a default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths.To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.Windows Me/98/95:  This string must not exceed MAX_PATH characters. 根据返回值判断是否成功。
      

  2.   

    判断路径长度是否大于MAX_PATH这个宏所定义的长度。一般是256