uLib  User mode C/C++ extended API library for Win32 programmers.
MultiByte Translations

Module Description

These functions convert between Unicode and Ansi/MultiByte.

Functions

ASTR mem_ADupWStr (WCSTR WStr, UINT CodePg=CP_ACP, UINT ccExtra=0)
 
WSTR mem_WDupAStr (ACSTR AStr, UINT CodePg=CP_ACP, UINT ccExtra=0)
 
ACSTR _MBStr (WCSTR pWStr)
 

Function Documentation

◆ mem_ADupWStr()

ASTR mem_ADupWStr ( WCSTR  WStr,
UINT  CodePg = CP_ACP,
UINT  ccExtra = 0 
)

Allocate an ANSI string and translate from wide string.

Parameters
WStrWide-string to translate.
CodePgCodepage to use for translation.
ccExtraNr of extra chars to add to allocation (e.g. for catenation).

Dispose with mem_Free() or mem_FreeStr().

Definition at line 290 of file StrFunc.cpp.

◆ mem_WDupAStr()

WSTR mem_WDupAStr ( ACSTR  AStr,
UINT  CodePg = CP_ACP,
UINT  ccExtra = 0 
)

Allocate a UNICODE string and translate from ANSI/MB string.

Parameters
AStrAnsi/MultiByte string to translate.
CodePgCodepage to use for translation.
ccExtraNr of extra chars to add to allocation (e.g. for catenation).

Dispose with mem_Free() or mem_FreeStr().

Definition at line 298 of file StrFunc.cpp.

◆ _MBStr()

ACSTR _MBStr ( WCSTR  pWStr)

Unicode to multibyte hand-me-on-the-fly translation (e.g for DPrint()).
_MBStr() uses an internal static buffer of MAX_PATH chars.

Definition at line 281 of file StrFunc.cpp.