新手求教:我的vs2010库里为什么找不到CString类?除了vb,f#,c#没装,其它都装了,而且我用联网帮助也找不到???
解决方案 »
- 菜鸟求助,关于MFC中OnDraw的问题
- 如何给指定进程发送消息,模拟键盘输入??
- 怎么理解字体与字符集的关系
- 设置CFormView的背景颜色
- 有没有xdjm用程序模拟过打开一个ie窗口又点击其中的toolbaritem?(如有,另开贴讨论)
- 关于分视之后,视图内画图消失问题
- 请帮我看看??
- 在Windows XP下如何为VC++.NET的应用程序进行打包发布,使得在非.NET平台下(如win98、winME、win2000等)也能使用??
- 大家好!急问:在mfc中如何监控某个按钮控件被按下?(100)
- 如何让CEDIT不失去焦点
- 自绘带图标的工具栏为什么图标没有颜色
- Dialog调用ResizeParentToFit
你建的是什么工程? 只有MFC支持的工程才能用CString,如果找不到,用string代替吧。
要么就在Win32程序里#include <afx.h>并在工程配置里选上使用MFC的项。
如果你的不支持,请查看stdafx文件中引入的.h库,其中#include <afxwin.h> 是很重要的。
下面是我的stdafx.h文件内容
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently#pragma once#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#endif#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif#include "targetver.h"#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT#include <afxcontrolbars.h> // MFC support for ribbons and control bars