RtlStringCbPrintf is not in ntstrsafe.h as described
RtlStringCbPrintf is not in ntstrsafe.h as described
我试图使用RtlStringCbPrintf与Winsock内核。我已经包含了nstrsafe .h,但是编译器给了我错误
Error 4 error C3861: 'RtlStringCbPrintf': identifier not found c:bwepic_slmusslcommmusslcommcommmessengersocketx.h 124 1 CommMessenger
如果我使用RtlStringCbPrintfA或RtlStringCbPrintfW,那么它确实编译。为什么我不能使用通用版本?在Ntstrsafe.h中,我看到了RtlStringCbPrintfA和RtlStringCbPrintfW的原型声明,但没有RtlStringCbPrintf的声明,尽管注释提到了它。为什么我不能使用通用形式,以便我的字符集属性选择使用哪个版本?我的字符集属性设置为使用多字节字符集
因为windows没有为这两个函数提供RtlStringCbPrintf定义。从msdn:
使用RtlStringCbPrintfW处理Unicode字符串和RtlStringCbPrintfA处理ANSI字符串。您使用的形式取决于你的数据. .
msdn中的示例使用RtlStringCbPrintfW()函数,而不是RtlStringCbPrintf()。
你可以自己定义RtlStringCbPrintf():
#if defined(UNICODE)
# define RtlStringCbPrintf RtlStringCbPrintfA
#else
# define RtlStringCbPrintf RtlStringCbPrintfW
#endif
相关文章:
- 为什么我会" void value not ignored as it ought to be"?
- 为什么 std::shared_ptr 被认为是"heavy"和"expensive",但 std::array "same perfprmance as plain (c-style) arrays
- 了解 Linux 虚拟内存:valgrind 的 massif 输出显示了有和没有 --pages-as-heap 的主要差异
- 编译错误:"lvalue required as left operand of assignment" 不确定原因
- 如何理解"Temporary objs are destroyed as the last step in evaluating the full-expression"?谁能用一些简单的例子来说明这
- Atom gpp编译器给出"'C:UsersadminUser' is not recognized as an internal or..."错误
- r-在Rcpp和C++之间转换矢量(使用Rcpp::as或Rcpp:::wrap)是否会创建一个新的矢量并复制元素
- template<class T, int N> void h(T const(&)[N]); as friend function
- 我正在"void value not ignored as it ought to be"我该怎么办?
- "expression cannot be used as a function"回报声明
- OMNeT++ cPacket as std::bitset 以应用 Reed-Solomon 编码
- 函数如何在不这样做的情况下在新线程上运行"as if"?
- C++指针算术"lvalue required as left operand of assignment"错误
- 当调用时,为什么ranges ::累积的init as std :: Move(init)
- 如何在开关语句中使用 cin "as a parameter"
- regex_match as predicate
- 类型转换运算符重载与 as 非成员函数
- 我在 MinGW 和 VS 代码"g++ not recognized as a cmdlet..."时遇到构建错误
- SpinBoxDelegate displayed as a DoubleSpinBoxDelegate
- RtlStringCbPrintf is not in ntstrsafe.h as described