Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Resources
Strings
String Reference
Functions
 CharToOem Function
CharToOem Function

The CharToOem function translates a string into the OEM-defined character set.

Syntax

BOOL CharToOem(      
    LPCTSTR lpszSrc,     LPSTR lpszDst );

Parameters

lpszSrc
[in] Pointer to the null-terminated string to translate.
lpszDst
[out] Pointer to the buffer for the translated string. If the CharToOem function is being used as an ANSI function, the string can be translated in place by setting the lpszDst parameter to the same address as the lpszSrc parameter. This cannot be done if CharToOem is being used as a wide-character function.

Return Value

The return value is always nonzero except when you pass the same address to lpszSrc and lpszDst in the wide-character version of the function. In this case the function returns zero and GetLastError returns ERROR_INVALID_ADDRESS.

Remarks

Windows 95/98/Me: CharToOemW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Function Information

Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systems Windows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker