Udostępnij za pośrednictwem


CA2CAEX Class

 

The latest version of this topic can be found at CA2CAEX Class.

This class is used by string conversion macros CA2CTEX and CT2CAEX, and the typedef CA2CA.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

Syntax

template<int t_nBufferLength = 128>  
class CA2CAEX

Parameters

t_nBufferLength
The size of the buffer used in the translation process. The default length is 128 bytes.

Members

Public Constructors

Name Description
CA2CAEX::CA2CAEX The constructor.
CA2CAEX::~CA2CAEX The destructor.

Public Operators

Name Description
CA2CAEX::operator LPCSTR Conversion operator.

Public Data Members

Name Description
CA2CAEX::m_psz The data member that stores the source string.

Remarks

Unless extra functionality is required, use CA2CTEX, CT2CAEX, or CA2CA in your own code.

This class is safe to use in loops and won't overflow the stack. By default, the ATL conversion classes and macros will use the current thread's ANSI code page for the conversion.

The following macros are based on this class:

  • CA2CTEX

  • CT2CAEX

The following typedef is based on this class:

  • CA2CA

For a discussion of these text conversion macros, see ATL and MFC String Conversion Macros.

Example

See ATL and MFC String Conversion Macros for an example of using these string conversion macros.

Requirements

Header: atlconv.h

CA2CAEX::CA2CAEX

The constructor.

CA2CAEX(LPCSTR psz, UINT nCodePage) throw(...);
CA2CAEX(LPCSTR psz) throw(...);

Parameters

psz
The text string to be converted.

nCodePage
Unused in this class.

Remarks

Creates the buffer required for the translation.

CA2CAEX::~CA2CAEX

The destructor.

~CA2CAEX() throw();

Remarks

Frees the allocated buffer.

CA2CAEX::m_psz

The data member that stores the source string.

LPCSTR m_psz;

CA2CAEX::operator LPCSTR

Conversion operator.

operator LPCSTR() const throw();

Return Value

Returns the text string as type LPCSTR.

See Also

CA2AEX Class
CA2WEX Class
CW2AEX Class
CW2CWEX Class
CW2WEX Class
Class Overview