StringCbPrintf_l 函数

原文:

Writes formatted data to the specified string. The size of the destination buffer is provided to the function to ensure that it does not write past the end of this buffer.

将有格式的数据写进指定的字符串中。目标缓冲区的大小是为了确保不会在写入缓存时溢出。


StringCbPrintf_l is similar to StringCbPrintf but includes a parameter for locale information.

String CbPrintf_l 与 StringCbPrintf类似,但它包括了一个现场参数。


Syntax  语法

C++
HRESULT StringCbPrintf(
  _Out_  LPTSTR pszDest,
  _In_   size_t cbDest,
  _In_   LPCTSTR pszFormat,
  _In_    ...
);

Parameters 参数

pszDest [out]

Type: LPTSTR

The destination buffer, which receives the formatted, null-terminated string created from pszFormat and its arguments.

目标缓存。接收的格式,从pszFormat和它的参数创建的空字符。

cbDest [in]

Type: size_t

The size of the destination buffer, in bytes. This value must be sufficiently large to accommodate the final formatted string plus the terminating null character. The maximum number of bytes allowed is STRSAFE_MAX_CCH * sizeof(TCHAR).

目标缓存的字节大小。这个值必须足够大去容纳格式字符串最后附加的null空字符。允许最大的字节数为STRSAFE_MAX_CCH * sizeof(TCHAR).

pszFormat [in]

Type: LPCTSTR

The format string. This string must be null-terminated.

格式字符串。这个字符串必须以null结束。

... [in]

The arguments to be inserted into the pszFormat string.

被插入到pszFormat字符串的参数。

Return value


Type: HRESULT

This function can return one of the following values. It is strongly recommended that you use the SUCCEEDED and FAILED macros to test the return value of this function.

这个函数返回一个跟随值,这个值可以让你知道是否成功。

Return code Description
S_OK

There was sufficient space for the result to be copied to pszDest without truncation, and the buffer is null-terminated.

STRSAFE_E_INVALID_PARAMETER

The value in cbDest is either 0 or larger than STRSAFE_MAX_CCH * sizeof(TCHAR).

STRSAFE_E_INSUFFICIENT_BUFFER

The copy operation failed due to insufficient buffer space. The destination buffer contains a truncated, null-terminated version of the intended result. In situations where truncation is acceptable, this may not necessarily be seen as a failure condition.

 

Note that this function returns an HRESULT value, unlike the functions that it replaces.

注意:这个函数返回一个HRESULT值。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值