Wiki Home

COMReturn Error


Namespace: WIN_COM_API
Culled form VFP 6 help:

COMRETURNERROR( cExceptionSource, cExceptionText) Function
Populates the COM exception structure with information that Automation clients can use to determine the source of Automation errors.

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 on the COM exception structure and returns control to the client. Program execution on the Automation server is terminated from the point where COMRETURNERROR( ) is executed. The Automation server remains in memory and program execution on the Automation server resumes at the next method called by the client.

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

Example:
FUNCTION Error(nError, cMethod, nLine)
		COMreturnerror(cMethod+'  err#='+str(nError,5)+'
line='+str(nline,6)+' '+message(),_VFP.ServerName)

Contributor: VFP Help, Steven Black
Category ActiveXControls, Category C _ O _ M
( Topic last updated: 2008.10.26 09:33:11 AM )