Partilhar via


Standard COM Errors

Many, but not all, of the properties and methods of the Commerce Server objects use standard Component Object Model (COM) HRESULT return values to communicate whether the operation was successful or not.

In C++, these values are the actual return values from the methods themselves (including property get_ and put_ methods). The program must explicitly perform error checking by examining these return values, or use some variation of structured error handling.

In Microsoft Visual Basic, and in Visual Basic Scripting Edition as used in Active Server Pages (ASP), these values are placed in the Number property of the global Err object. Error handling is either handled automatically, displaying a standard error dialog box, or explicitly by the program, checking the value of the Number property of the global Err object. The On Error Resume Next command disables automatic error handling, thereby enabling explicit error handling.

The following table shows the most common standard COM errors returned by the properties and methods of the Commerce Server objects.

Constant

Value (32-bit)

Description

S_OK

00000000

The standard return value used to communicate successful completion.

S_FALSE

00000001

An alternate success value, typically used to communicate successful, but non-standard completion. The precise meaning depends on the method or property in question.

E_UNEXPECTED

8000FFFF

Catastrophic failure error.

E_NOTIMPL

80004001

Not implemented error.

E_OUTOFMEMORY

8007000E

Out of memory error.

E_INVALIDARG

80070057

One or more arguments are not valid error.

E_NOINTERFACE

80004002

Interface not supported error.

E_POINTER

80004003

Pointer not valid error.

E_HANDLE

80070006

Handle not valid error.

E_ABORT

80004004

Operation aborted error.

E_FAIL

80004005

Unspecified error.

E_ACCESSDENIED

80070005

General access denied error.

Additional information may be available using the global Err object. In Visual Basic, the Description property of the Err object may contain a text description of the error.

In C++, call the API function GetErrorInfo to retrieve the most recently set IErrorInfo pointer in the current logical thread. The GetDescription method of that interface may return a text description of the error.

See Also

Other Resources

COM Object Reference