IMLangConvertCharset::DoConversion method

Converts the given string from the source code page of the Conversion object to its destination code page.

Syntax

HRESULT DoConversion(
  [in]      BYTE *pSrcStr,
  [in, out] UINT *pcSrcSize,
  [in]      BYTE *pDstStr,
  [in, out] UINT *pcDstSize
);

Parameters

  • pSrcStr [in]
    A pointer to the string to be converted.

  • pcSrcSize [in, out]
    A pointer to an unsigned integer that stores the length of the source string, in bytes. If this is NULL, or if the length specified is -1, the method assumes pSrcStr is null-terminated.

  • pDstStr [in]
    A pointer to the string where the conversion result is stored.

  • pcDstSize [in, out]
    A pointer to an unsigned integer that stores the length, in bytes, of the string specified with pDstStr. When conversion is successful, the method returns the number of bytes copied to pDstStr.

Return value

Returns one of the following values.

Return code Description
S_OK

Success.

S_FALSE

The specified conversion is not supported. This happens when a newly detected code page is not supported on the system.

E_FAIL

An error occurred.

 

Remarks

Note that this method takes streams and counts, regardless of the type of conversion (Unicode or multibyte), unlike IMLangConvertCharset::DoConversionFromUnicode and IMLangConvertCharset::DoConversionToUnicode.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mlang.h

IDL

Mlang.idl

DLL

Mlang.dll

See also

IMLangConvertCharset

IMLangConvertCharset::Initialize