大网数据广告活动
Windows 系统接口

COM Error Handling in Java and Visual Basic

· 52CE 我爱测

COM Error Handling in Java and Visual Basic

There are three interfaces and three functions that can be used in COM to provide error handling when programming in Java or Microsoft Visual Basic. In Java and Visual Basic, the method call does not return an HRESULT as the return value. Instead, these languages use the COM interfaces and functions to obtain HRESULT values and to handle errors or exceptions. (Exceptions are events beyond the program's control, such as file problems or invalid parameters.)

The three interfaces that provide support for HRESULTs are listed and described briefly in the following table.

Interface Description
ICreateErrorInfo Sets error information.
IErrorInfo Returns information from an error object.
ISupportErrorInfo Identifies the object as supporting the IErrorInfo interface.

The three functions that provide support for HRESULTs are listed and described briefly in the following table.

Interface Description
CreateErrorInfo Creates an instance of a generic error object.
GetErrorInfo Obtains the error information pointer set by the previous call to SetErrorInfo in the current logical thread.
SetErrorInfo Sets the error information object for the current thread of execution.

Related topics

Error Handling in COM

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。