private const int MAXERRORLENGTH = 256;
/// <summary>
/// This function gets a string describing the error returned from one of the wave functions.
/// </summary>
/// <param name="mmrError">The error code</param>
/// <param name="pszText">String returning the text description</param>
/// <param name="cchText">The size of the string</param>
/// <returns>NOERROR success, otherwise fail.</returns>
[DllImport ("winmm.dll", EntryPoint="waveOutGetErrorText", SetLastError=true, CharSet=CharSet.Auto)]
private static extern uint waveOutGetErrorText(uint mmrError, StringBuilder pszText, uint cchText);
/// <summary>
/// This function gets a string describing the error returned from one of the wave functions.
/// </summary>
/// <param name="mmrError">The error code</param>
/// <returns>The description</returns>
public static string waveOutGetErrorText(int mmrError)
{
StringBuilder message = new StringBuilder(MAXERRORLENGTH);
uint errorResult = waveOutGetErrorText(mmrError, message, (uint)message.Capacity);
if (errorResult == 0)
{
return message.ToString();
}
else
{
return "waveOutGetErrorText failed.";
}
}
Declare Function waveOutGetErrorText Lib "winmm.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
None.
Please add some!
Please add some!