共用方式為


HexFromBin

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Converts a binary number into a string representation of a hexadecimal number.

Header file:

Mapiutil.h

Implemented by:

MAPI

Called by:

Client applications and service providers

void HexFromBin(
  LPBYTE pb,
  int cb,
  LPSTR sz
);

Parameters

  • pb
    [in] Pointer to the binary data to be converted.

  • cb
    [in] Size, in bytes, of the binary data pointed to by the pb parameter.

  • sz
    [out] Pointer to a null-terminated ASCII string representing the binary data in hexadecimal digits.

Return Value

None.

Remarks

The HexFromBin function takes a pointer to a unit of binary data whose size is indicated by the cb parameter. It returns in the sz string, within (2*cb)+1 bytes of memory, a representation of this binary information in hexadecimal numbers. If the byte value is decimal 10, for example, the hexadecimal string will be 0A, so one byte converts to two bytes in the string.