Handling Errors

When an application runs, problems occasionally arise that can halt your code unexpectedly. The problem may stem from an event or operation that did not work as expected, a hardware problem, or the result of trying to carry out an impossible or invalid maneuver. These types of errors are known as run-time errors because they occur while code is running.

You also can receive errors while compiling an application. These compilation errors typically occur because syntax was entered incorrectly. When the toolkit detects a compilation error, it displays a message notifying you of the error.

The following sections explain how to trap and handle run-time errors when creating Visual Basic for Windows CE applications. They also describe the types of error you may encounter when compiling your application and how to handle the errors.