Example #1
0
        /// <summary>
        /// Test the ConvertTimeFormat function
        /// </summary>
        void TestConvert()
        {
            int       hr;
            long      pTarget;
            const int iPos = 12345;

            // While ConvertTimeFormat supports nulls, it appears that
            // the AsyncReader doesn't implement them correctly.  Tests against
            // my video camera show null working correctly.
            hr = m_ims.ConvertTimeFormat(
                out pTarget,
                null,
                iPos,
                TimeFormat.Byte
                );
            //Marshal.ThrowExceptionForHR(hr);

            // Anything besides TimeFormat.Byte throws an error.
            hr = m_ims.ConvertTimeFormat(
                out pTarget,
                TimeFormat.Byte,
                iPos,
                TimeFormat.Byte
                );
            Marshal.ThrowExceptionForHR(hr);

            Debug.Assert(pTarget == iPos, "ConvertTimeFormat");
        }