WMEncoder.OnError
The OnError event receives run-time error event notices.
Syntax
WMEncoder.OnError(hResult)
Parameters
hResult
[in] ** Long containing the error code. This can be one of the following values.
Value | Number | Description |
NS_E_BAD_MARKIN | 0xC00D1B58 | The starting time must be greater than zero and less than the ending time. |
NS_E_BAD_MARKOUT | 0xC00D1B59 | The ending time must be greater than the starting time and less than the file duration. |
NS_E_VIDEODEVICE_BUSY | 0xC00D1B64 | The video capture device is in use and cannot be opened. |
NS_E_VIDEODRIVER_UNSTABLE | 0xC00D1B68 | The video capture driver returned an unrecoverable error. |
NS_E_VIDCAPSTARTFAILED | 0xC00D1B69 | The video capture device did not start. |
NS_E_VIDCAPCREATEWINDOW | 0xC00D1B6D | The video capture window was not created. |
NS_E_INVALIDCALL_WHILE_ARCHIVAL_RUNNING | 0xC00D1B74 | The specified operation is not allowed when the file is being archived. |
NS_E_ARCHIVE_FILENAME_NOTSET | 0xC00D1B79 | The archive file name is not properly specified. |
NS_E_INVALIDCALL_WHILE_ENCODER_STOPPED | 0xC00D1B7F | The specified operation is not allowed when the encoder engine is not running. |
NS_E_INVALID_INPUTFPS | 0xC00D1B81 | Inverse telecine cannot be specified when the frame rate does not equal 30 frames per second. |
NS_E_NO_DATAVIEW_SUPPORT | 0xC00D1B82 | Internal problems are preventing the preview or postview. |
NS_E_CODEC_UNAVAILABLE | 0xC00D1B83 | One or more required codecs cannot be found. |
NS_E_UNEXPECTED_DISPLAY_SETTINGS | 0xC00D1B88 | The display size or color setting has changed since the encoding session was defined. |
Return Values
This event does not return a value.
Remarks
Use the OnError method to respond to run-time error event notices. The ErrorState method in the WMEncoder object provides another way to retrieve errors while the encoding process is running. If you are comparing hResult to a hexadecimal error code, eliminate the leading "Ox" from the hex value.
Example Code
Private Sub Encoder_OnError(ByVal hResult As Long)
If Hex(hResult) = "C00D1B66" Then
' Process the error.
' OxC00D1B66 = NS_E_INVALIDCALL_WHILE_ENCODER_RUNNING
End If
End Sub
Requirements
Reference: Windows Media Encoder
Library: wmenc.exe
See Also