c++uwpc++-winrt

Unhandled exception: An invalid parameter was passed to a function that considers invalid parameters fatal in UWP application


So I was making a polynomial simplifier for my school project. I decided to make the application using C++ UWP in Visual Studio.

As one of the extra features of the application I implemented a system to store and retrieve polynomials from a file so that you can access your previously entered polynomials. I am using boost::filesystem for this. The code compiles fine. But while debugging, this function:

fs::exists(basePath) // namespace fs = boost::filesystem

...is somehow causing the following exception:

Unhandled exception at 0x00007FFBB71AAFEC (ucrtbased.dll) in ExpressionSimplifierV4 UWP.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.

..thrown from this line:

rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); // App.xaml.cpp

What is the cause of this exception, and how do I resolve it?


Solution

  • When writing UWP applications, be aware that they by design run in a 'locked-down' environment. One aspect of this is that they have very limited access to the file system.

    A UWP application by default has:

    Any attempt to access a file folder other than those above by default will fail.

    See Microsoft Docs.