Warm tip: This article is reproduced from serverfault.com, please click

C++ UWP Storage Access

发布于 2020-12-31 04:17:55

After rescap capability configuration and privacy setting File system allow still we cannot access File system and other drives to read file and configure model path for open pose in c++. I have tried many possibilities i cant access assets folder *.png file also.

enter image description here

Questioner
Sethu Raman
Viewed
0
Martin Zikmund 2020-12-31 19:22:26

Even with the broadFileSystemAccess capability you won't be able to access an arbitrary path on the file system with ordinary APIs, you have to use the StorageFile/StorageFolder APIs instead. From the screenshot I see you are trying to read the image using OpenCV, so instead of using a path, you will need to read the image using a StorageFile and use a different imread overload which accepts a byte array or stream. Alternatively, you could copy the file from the given path to ApplicationData.Current.LocalFolder which is accessible using any API, including imread