Beispiel #1
0
        void TestStrings()
        {
            int hr;
            int pulwActualSize;
            int pulActualSize;
            DvdTextStringType pType;
            DvdTextStringType pwType;
            int            pulNumOfLangs;
            int            pulNumOfStrings;
            int            pLangCode;
            DvdTextCharSet pbCharacterSet;

            hr = m_idi2.GetDVDTextNumberOfLanguages(out pulNumOfLangs);
            DsError.ThrowExceptionForHR(hr);

            if (pulNumOfLangs > 0)
            {
                hr = m_idi2.GetDVDTextLanguageInfo(0, out pulNumOfStrings, out pLangCode, out pbCharacterSet);
                DsError.ThrowExceptionForHR(hr);

                StringBuilder sb1 = new StringBuilder(255, 255);
                hr = m_idi2.GetDVDTextStringAsNative(0, pulNumOfStrings - 1, sb1, sb1.Capacity, out pulActualSize, out pType);
                DsError.ThrowExceptionForHR(hr);

                Debug.Assert(sb1.Length > 0, "GetDVDTextStringAsNative");

                StringBuilder sb2 = new StringBuilder(255, 255);
                hr = m_idi2.GetDVDTextStringAsUnicode(0, pulNumOfStrings - 1, sb2, sb2.Capacity, out pulwActualSize, out pwType);
                DsError.ThrowExceptionForHR(hr);

                Debug.Assert(sb2.Length > 0, "GetDVDTextStringAsUnicode");
            }
        }