Why is RemoveDirectory function not deleting the top most folder?

后端 未结 3 1141
故里飘歌
故里飘歌 2020-12-18 12:11

refer: codeguru.com/forum/showthread.php?t=239271

When using the function below to delete folders, all folders, subfolders and files are getting deleted except for

3条回答
  •  有刺的猬
    2020-12-18 12:40

    I believe you have to close the file handle before the recursive call. Which means after exiting the recursive call you must again set your your file handle to something appropriate.

    SHFileOperation may be a better solution; I am just answering the OP's question of why their code wasn't working as intended.

提交回复
热议问题