运行控制台程序时 跳出如下错误
An unhandled exception of type 'System.Runtime.InteropServices.SEHException'
occurred in 。。
Additional information: External component has thrown an exception.
问题原因:
程序中有个打开文件命令: ifstream fin("Data//100_ground_5.xyz");
没有将文件地址写正确
解决方法: 将其修改为正确的文件地址
ifstream fin("Data_xyz//100_ground_5.xyz");
参考资料:
The Unspecified sample illustrates throwing an unmanaged exception (unspecified exception) and catching it in a catch handler.
Building and Running the Sample
To build and run Unspecified using Visual Studio
- In the Visual Studio IDE, load the solution file Unspecified.sln.
- In Solution Explorer, right-click the Unspecified solution.
- On the shortcut menu, click Build.
- On the Debug menu, click Start.
The following output is displayed in the console window:
System.Runtime.InteropServices.SEHException: External component has thrown an exception. at _CxxThrowException(Void* , _s__ThrowInfo* ) at main()
Classes and Keywords
This sample demonstrates the following class:
Exception
This sample demonstrates the following keywords:
try, catch, throw