HAPI.ErrorCodes Class Module

Startpage
Overview
Index
HAPI
   |
   HAPI.ErrorCodes

Enums

hErrors
The hErrors enumeration type lists all the possible errors that this server can raise.

Description

The ErrorCodes class module the most important error codes which the HUGINAPI ActiveX server can raise. The ErrorCodes class module is "GlobalMultiUse" which means that you don't need to create an instance of it to use it. When an error is raised, the error number read from the Visual Basic Err object is "vbObjectError + e" where e is an error code from the hErrors Enum type.

Errors can be raised which are not documented here. These will always be described in the Err.Description property.

Example: This small piece of code shows how a function could handle an error generated by the HUGINAPI ActiveX server:

 Function GetANode(d As HUGINAPI.Domain, n As HUGINAPI.Node, newname as String) As Boolean
 On Error Goto ErrorHandler
 
 Set n = d.GetNewNode(hCategoryChance, hKindDiscrete)
 n.Name = newname

 GetANode = True
 Exit Function

ErrorHandler:
 MsgBox("Error: " & Err.Number - vbObjectError & " => " & Err.Description)
 GetANode = False
End Function

If this function is able to create a new node and give it the specified name without generating an error, it returns True. Otherwise, it shows the error code and message and returns False.


HUGIN Expert A/S, 2008 - comments to activex@hugin.com