midiOutGetErrorText() public static method

Gets the error text for a return code related to an output device.
public static midiOutGetErrorText ( MMRESULT mmrError, StringBuilder lpText ) : MMRESULT
mmrError MMRESULT
lpText StringBuilder
return MMRESULT
Example #1
0
        ///// <summary>
        ///// Returns the handle to the current OutputDevice as a Strut
        ///// </summary>
        ////public static Int32 DeviceHandle(OutputDevice od)
        //public static Win32API.HMIDIOUT DeviceHandle(OutputDevice od)
        //{
        //    lock (staticLock)
        //    {
        //        //return od.handle.handle;
        //        return od.handle;
        //    }
        //}
        ///// <summary>
        ///// Returns the handle to the current OutputDevice as an Integer
        ///// </summary>
        //public static Int32 DeviceHandleHandle(OutputDevice od)
        ////public static Win32API.HMIDIOUT DeviceHandle(OutputDevice od)
        //{
        //    lock (staticLock)
        //    {
        //        //return od.handle.handle;
        //        return od.handle.handle;
        //    }
        //}

        #endregion

        #endregion

        #region Private Methods

        /// <summary>
        /// Makes sure rc is MidiWin32Wrapper.MMSYSERR_NOERROR.  If not, throws an exception with an
        /// appropriate error message.
        /// </summary>
        /// <param name="rc"></param>
        private static void CheckReturnCode(Win32API.MMRESULT rc)
        {
            if (rc != Win32API.MMRESULT.MMSYSERR_NOERROR)
            {
                StringBuilder errorMsg = new StringBuilder(128);
                rc = Win32API.midiOutGetErrorText(rc, errorMsg);
                if (rc != Win32API.MMRESULT.MMSYSERR_NOERROR)
                {
                    throw new DeviceException("no error details");
                }
                throw new DeviceException(errorMsg.ToString());
            }
        }