.NET Errors and Exceptions
- Updated2023-02-21
- 1 minute(s) read
If an error occurs during a call to a function in the LabWindows/CVI .NET Library, the status return value contains the error code. You can use CDotNetGetErrorDescription to get a description of the error code. The LabWindows/CVI .NET Library error codes are defined in cvi\include\cvidotnet.h.
.NET assemblies return exceptions to indicate incorrect function behavior. Whenever an exception is caught and returned, the function in which the exception occurred returns an error code in the return value. LabWindows/CVI returns either a specific .NET Library error code that corresponds to the exception or CDotNetExceptionError.
Some generated wrapper functions and LabWindows/CVI .NET Library functions include an exceptionHandle parameter, which returns a handle to the thrown exception. You can pass the exception handle to CDotNetGetExceptionInfo to get information about the exception. If a function does not include an exceptionHandle parameter, only the error code is available.
![]() |
Note You must use CDotNetDiscardHandle to discard any exception handles the .NET assemblies return. |
