ErrorStack.Add method

AutoCAD Map 3D ActiveX

ErrorStack.Add method

Adds a user-defined error to the top of the error stack.

Add( ErrorCode As EErrCode, _
 ErrorType As EAdeErrType, _
 ErrorMessage As String _
 ) As ErrorEntry

Returns the added ErrorEntry collection.

ErrorCode

An EErrCode constant representing an error that occurred.

ErrorType

An EAdeErrType constant identifying the type of error that occurred.

ErrorMessage

A string containing a description of the error.

The following example adds an error to the error stack, gets it from the stack, and displays it.

Dim amap As AcadMap

Dim ee As ErrorEntry

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set ee = amap.ErrorStack. _

Add(345, kAdeWarning, "Abnormal termination") 

MsgBox "" & amap.ErrorStack.Item(0).ErrMessage