GetMCIErrorString - Retrieving the description of a MCI error
<System.Runtime.InteropServices.DllImport("winmm.dll")> Shared Function _
mciGetErrorString(ByVal dwError As Integer, _
ByVal lpstrBuffer As System.Text.StringBuilder, ByVal uLength As Integer) _
As Integer
End Function
' Get the description of a MCI error.
'
' ErrorCode is the code of the error
' Return a string with the description of the error.
Function GetMCIErrorString(ByVal errorCode As Integer) As String
Dim buffer As New System.Text.StringBuilder(256)
mciGetErrorString(errorCode, buffer, buffer.Capacity)
Return buffer.ToString()
End Function