Exceptions

<< Click to Display Table of Contents >>

Navigation:  How To Use the VPE Control > VPE ActiveX >

Exceptions

Previous pageReturn to chapter overviewNext page

In case of error conditions, the VPE ActiveX might raise errors. We call that "throw exceptions".

Properties and methods of the VPE ActiveX which raise errors are marked in this reference.

Visual Basic for example offers three statements to handle these errors:

On Error GoTo line

On Error Resume Next

On Error GoTo 0

Visual Basic: please note that Err.Number needs to be compared with the VPE Exception Code + the constant value vbOBJECTERROR.

Select Case Err.Number

 case VPE_E_APIFAILED + vbOBJECTERROR   'Error caused by VPE API

         If VPE.LastError = VERR_TPL_AUTHENTICATION Then

                 MsgBox("'sample2.dcd' has been modified.", "Error:", MB_OK);

         ElseIf VPE.LastError = VERR_FILE_OPEN Then

                 MsgBox("'sample2.dcd' not found or no access rights.",

                         "Error:", MB_OK);

         Else

                 MsgBox("'sample2.dcd' could not be read.", "Error:", MB_OK);

         End If

 case Else

         'Handle other situations here...

 End Select

End Sub

Please consult the documentation of your programming language / tool for further details on how to handle errors.

 

Possible VPE Exception Codes raised by the ActiveX are:

VPE_E_NEEDOPENDOCUMENT

1024

 

The VPE Document is not open. You need to call OpenDoc prior to this operation.

 

VPE_E_ NEEDCLOSEDDOCUMENT

1025

 

The VPE Document is open. The document needs to be closed prior to this operation.

 

VPE_E_ ENGINEAPI

1026

 

An underlaying API routine was not found in the VPE dynamic link library.

 

VPE_E_ OUTOFRANGE

1027

 

The argument is out of range.

 

VPE_E_ NOTIMPL_EDITION

1028

 

Sorry, this feature is not implemented in this edition of VPE.

 

VPE_E_ NOWINDOW

1029

 

Need a window to perform this operation. The object must have been in-place activated first.

 

VPE_E_ APIFAILED

1030

 

An underlaying VPE API routine has failed. Possible causes: Invalid arguments, conversion of data type impossible, Out of Memory, etc.

 

VPE_E_ INVALIDOBJECTHANDLE

1031

 

The handle to the object is invalid: it does not point to a valid VPE DLL object. Probably the method/property that returned the object has failed.

 

VPE_E_ VPEGETFAILED

1032

 

The value could not be retrieved. Possible causes: Field/Control not found, Data Type Conversion Impossible or Out of Memory.

 

VPE_E_ VPESETFAILED

1033

 

The value could not be set. Possible causes: Field/Control not found, Data Type Conversion Impossible or Out of Memory.