IDvdInfo2::GetDVDTextStringAsUnicode method

The GetDVDTextStringAsUnicode method retrieves a DVD text string for a specified language, and returns the text string as a Unicode string.


HRESULT GetDVDTextStringAsUnicode(
  [in]  ULONG              ulLangIndex,
  [in]  ULONG              ulStringIndex,
  [out] WCHAR              *pchBuffer,
  [in]  ULONG              ulMaxBufferSize,
  [out] ULONG              *pulActualSize,
  [out] DVD_TextStringType *pType


ulLangIndex [in]

Zero-based index of the language. To find the number of text-string languages on the DVD, call IDvdInfo2::GetDVDTextNumberOfLanguages.

ulStringIndex [in]

Zero-based index of the string to retrieve. To find the number of strings for a given language, call IDvdInfo2::GetDVDTextLanguageInfo.

pchBuffer [out]

Pointer to a buffer that receives the text string. If pchBuffer is NULL, this method returns the size of the string in pulActualSize.

ulMaxBufferSize [in]

Size of the pchBuffer buffer, in WCHARs.

pulActualSize [out]

Receives the actual length of the string in characters, including the terminating NULL.

pType [out]

Receives a member of the DVD_TextStringType enumeration. The value indicates the type of text string, such as movie title or song name. This parameter can also receive values that are not defined in the DVD_TextStringType enumeration.

Return value

Returns one of the following HRESULT values.

Return codeDescription



Unsupported te


Invalid argument.


An unexpected internal error occurred.



This method supports text strings that are encoded as Unicode or 7-bit ASCII (ISO/IEC 646). If the text string uses ASCII encoding, the method converts the string to a wide-character string. If the text string uses any other character set, the method returns E_FAIL. In that case, you can call IDvdInfo2::GetDVDTextStringAsNative to retrieve the string as a raw byte array. To find the character set, call IDvdInfo2::GetDVDTextLanguageInfo.

The returned string always includes a terminating NULL. If the buffer is smaller than the length of the DVD text string, the string is truncated. To find the required size of the buffer, call the method once with pchBuffer equal to NULL and ulMaxBufferSize equal to zero. The size is returned in pulActualSize. Then allocate a buffer and call the method again.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]


Strmif.h (include Dshow.h)



See also

DVD Applications
Error and Success Codes
IDvdInfo2 Interface
Working with DVD Text Strings