Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IMultiLanguage2::ConvertString method

Converts the given source string from the source code page to the destination code page.

Syntax


HRESULT ConvertString(
  [in, out] DWORD *pdwMode,
  [in]      DWORD dwSrcEncoding,
  [in]      DWORD dwDstEncoding,
  [in]      BYTE  *pSrcStr,
  [in, out] UINT  *pcSrcSize,
  [in]      BYTE  *pDstStr,
  [in, out] UINT  *pcDstSize
);

Parameters

pdwMode [in, out]

The address of storage for conversion context. The calling function should only provide storage that is initialized with zero at the first call to the method. The caller should not modify this value.

dwSrcEncoding [in]

The code page identifier value for the source string. This value is equivalent to the uiCodePage member of the MIMECPINFO structure assigned to dwSrcEncoding.

dwDstEncoding [in]

The code page identifier value for the destination string. This value is equivalent to the uiCodePage member of the MIMECPINFO structure assigned to dwDstEncoding.

pSrcStr [in]

The address of the string to be converted.

pcSrcSize [in, out]

The ddress of the buffer that stores the length of the source string, in bytes. If this is NULL, or if the length specified is -1, the API assumes pSrcStr is null-terminated. When conversion is successful, the method returns the number of bytes processed to this buffer.

pDstStr [in]

The address of the string buffer where the conversion result is stored.

pcDstSize [in, out]

The address of the buffer that stores the length of pDstStr, in bytes. When conversion is successful, the method returns the number of bytes copied to pDstStr to this buffer.

Return value

Returns one of the following values.

Return codeDescription
S_OK

Success.

S_FALSE

The specified conversion is not supported on the system.

E_FAIL

An error occurred.

 

Remarks

Note that this method takes a pointer to a BYTE array for both the source string buffer and the destination string buffer. The size of this buffer is handled as the number of bytes for the inbound parameter and the outbound parameter.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mlang.h

IDL

Mlang.idl

DLL

Mlang.dll

See also

IMultiLanguage2

 

 

Show:
© 2017 Microsoft