Compartir a través de


COMRETURNERROR( ) Function

Populates the COM exception structure with information that Automation clients can use to determine the source of Automation errors.

COMRETURNERROR(cExceptionSource, cExceptionText)

Parameters

  • cExceptionSource
    Specifies the text for the source of the exception.

  • cExceptionText
    Specifies the text for the description of the exception.

Remarks

COMRETURNERROR( ) allows Visual FoxPro Automation servers to populate the COM exception structure so that Automation clients can determine the cause of an error on the Automation server.

Executing COMRETURNERROR( ) places the specified text in the COM exception structure, aborts executing the current method, and returns control to the client. The Automation server remains in memory and the client can call more Automation server methods.

Visual FoxPro clients can use AERROR( ) to view the text placed on the COM exception structure.

Note

(For advanced users) COMReturnErrorInfo fills in a COM exception information structure. This is used only for IDispatch (late binding calls). If you call the server via early binding and the client passes a COM exception structure to the server, there is no error mechanism to return the error info unless the client does a QueryInterface on the ISupportsErrorInfo interface.

See Also

Tasks

How to: Create Automation Servers

Reference

AERROR( ) Function

ON ERROR Command

COMCLASSINFO( ) Function

GETINTERFACE( ) Function

Error Messages Listed Alphabetically

Error Messages Listed Numerically

Other Resources

Functions

Language Reference (Visual FoxPro)