Name

ErrorCode

Description

HRESULT
ErrorCode([in] ULONGLONG err,
          [out,retval] USHORT* errorCode);

Get the part of the error value that represents the VIX error code. The error value returned from VIX functions contains multiple components; the least significant 16 bits are set to the error code. These error codes are described in the section on "Error Codes."

Parameters

err
An error value returned from a VIX functions.
errorCode
The error code that 'err' contains.

Return Value

HRESULT

Side Effects

None.

Requirements

VixCOM.h, since VMware Workstation 6.0.

Example

In VBScript:
Dim job
Dim err
Dim readOnly

' Power on the virtual machine in headless mode.
Set job = vm.PowerOn(VixCOM.Constants.VIX_POWEROP_NORMAL, Nothing, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorCode(err) = VixCOM.Constants.VIX_E_CANNOT_START_READ_ONLY_VM Then
   readOnly = TRUE
Else
   readOnly = FALSE
End If

Copyright (C) 2007-2011 VMware, Inc. All rights reserved.