Windows.h已经包含在afxv_w32.h - CString
windows.h already included afxv_w32.h - CString
我试图在我的 cpp 文件中包含 CString,但如果我包含 afxinet.h 会收到此错误
"Windows.H 已包含 afxv_w32.h"
这些是我的头文件:
#include stdafx.h
#include 什尔瓦皮·
#include Tlhelp32.h
#include 钩子.h
#include stdio.h
#include 常见1.h
#include 安全记录器
#include
#include tinyxml.h
#include Winsock.h>
#pragma 注释(lib, "Ws2_32.lib")
#include afxinet.h
我还没有将葫芦包含在堆栈中以显示在这里。
如何解决此问题并将CString包含在我的文件中
如果你想要CString
,为什么要添加afxinet.h
?
应包含atlstr.h
才能获得CString
- 尤其是在项目不是基于 MFC 的情况下。
在C++设置中使用/showIncludes
选项(在"高级"下)。这将显示如何包含标头(以树格式)。作为另一个建议,您应该只包含所需的文件。
通过包含 afx.h><,您应该能够在 cpp 文件中使用 CString 类。
#include <afx.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
CString str("Santosh");
wcout << LPCTSTR(str) << endl;
return 0;
}
Additionally, you will need to define _AFXDLL preprocessor
相关文章:
- 在C++中使用Cstring反转字符串
- 如何转换真实路径 CString c++
- __int64 CString 返回错误的值 - C++ MFC
- 如何将 SHFileOperation() 与 CString 路径一起使用
- 在_T值中使用 CString
- 没有大小参数的CString::GetBuffer()做什么
- 如何将 CString 转换为字节 [] 数组?
- 可视化 如何将 CString 值列表添加到 MFC C++ 中的组合框中?
- C++从 std::string 创建 CString 失败
- 对树节点使用 CString 时出现内存泄漏
- C++ 巨大 CString 的串联
- 无法从字符构造CString
- 将旧 cstring 的标记连接成新的 C 字符串
- 如何将 CComVariant bstr 转换为 CString
- C++ cstring 查找和替换
- 使用_tcscpy_s将 CString 复制到 TCHAR*
- StringCch* functions and Cstring
- 循环以使用 cstring 数组 c++ 获取用户输入
- 使用指针 c++ 反转函数中的 cstring 数组
- 如何将CString转换为使用WCHAR的Windows API和自定义函数?