Partager via


AtlHexEncode

Call this function to encode some data as a string of hexadecimal text.

inline BOOL AtlHexEncode(
   const BYTE * pbSrcData,
   int nSrcLen,
   LPSTR szDest,
   int * pnDestLen 
) throw( );

Parameters

  • pbSrcData
    The buffer containing the data to be encoded.

  • nSrcLen
    The length in bytes of the data to be encoded.

  • szDest
    Caller-allocated buffer to receive the encoded data.

  • pnDestLen
    Pointer to a variable that contains the length in characters of szDest. If the function succeeds, the variable receives the number of characters written to the buffer. If the function fails, the variable receives the required length in characters of the buffer.

Return Value

Returns TRUE on success, FALSE on failure.

Remarks

Each byte of source data is encoded as 2 hexadecimal characters.

Requirements

Header: atlenc.h

See Also

Reference

AtlHexDecodeGetRequiredLength

AtlHexDecode

AtlHexEncodeGetRequiredLength

Other Resources

ATL Concepts

ATL Reference

ATL Functions Alphabetical Reference