[英]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.
我决定在 Visual Studio 中使用 C++ UWP 来制作应用程序。
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.我为此使用
boost::filesystem
。 The code compiles fine.代码编译得很好。 But while debugging, this function:
但是在调试的时候,这个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.
ExpressionSimplifierV4 UWP.exe 中 0x00007FFBB71AAFEC (ucrtbased.dll) 处的未处理异常:无效参数已传递给认为无效参数致命的 function。
..thrown from this line: ..从这一行抛出:
rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments); // App.xaml.cpp
My question: What is the cause of this exception and how do I resolve it ?我的问题:这个异常的原因是什么,我该如何解决?
If any extra information is needed, do tell me... Thanks如果需要任何额外信息,请告诉我...谢谢
When writing UWP applications, be aware that they by design run in a 'locked-down' environment.在编写 UWP 应用程序时,请注意它们在设计上运行在“锁定”环境中。 One aspect of this is that they have very limited access to the file system.
一方面是他们对文件系统的访问非常有限。
A UWP application by default has:默认情况下,UWP 应用程序具有:
read-only access to its own installed directory (which is typically the 'current working directory' at start-up).对其自己安装的目录(通常是启动时的“当前工作目录”)的只读访问权限。 This is pointed to by
Windows.ApplicationModel.Package.Current.InstalledLocation
.这是由
Windows.ApplicationModel.Package.Current.InstalledLocation
指出的。
read/write access to its own per user application data directory.对其自己的每个用户应用程序数据目录的读/写访问权限。 The non-roaming version is
ApplicationData.Current.LocalFolder
.非漫游版本是
ApplicationData.Current.LocalFolder
。 The roaming version is ApplicationData.Current.RoamingFolder
.漫游版本是
ApplicationData.Current.RoamingFolder
。
read/write access to a per user application temporary directory that may or may not be there on future invocations of the application.对每个用户应用程序临时目录的读/写访问权限,该目录在将来调用应用程序时可能存在也可能不存在。 This is
ApplicationData.Current.TemporaryFolder
.这是
ApplicationData.Current.TemporaryFolder
。
Any attempt to access a file folder other than those above by default will fail .默认情况下,任何访问上述文件夹以外的文件夹的尝试都将失败。
See Microsoft Docs .请参阅Microsoft 文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.