首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

VS2010旗舰版 LPCTSTR 相关有关问题

2013-12-04 
VS2010旗舰版 LPCTSTR 相关问题刚接触VC不久,前几天出现如下问题,在网上搜了很多资料,依然没有改好。各位帮

VS2010旗舰版 LPCTSTR 相关问题
刚接触VC不久,前几天出现如下问题,在网上搜了很多资料,依然没有改好。各位帮帮忙啊
1>ClCompile:
1>  stdafx.cpp
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C2146: 语法错误: 缺少“)”(在标识符“lpszText”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C2864: “CWnd::lpszCaption”: 只有静态常量整型数据成员才可以在类中初始化
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2652): error C2146: 语法错误: 缺少“;”(在标识符“nType”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2652): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2652): error C2059: 语法错误:“)”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2652): error C2864: “CWnd::nType”: 只有静态常量整型数据成员才可以在类中初始化
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2653): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2653): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2957): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3698): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3704): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3712): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3868): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3879): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3881): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3883): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3886): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3887): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(3974): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4172): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4173): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4174): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4180): error C2059: 语法错误:“)”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4180): error C2143: 语法错误 : 缺少“)”(在“;”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4214): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4246): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4255): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4267): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4285): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4286): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4389): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4391): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4544): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数


1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4545): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4549): error C2059: 语法错误:“)”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4549): error C2143: 语法错误 : 缺少“)”(在“;”的前面)
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4625): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4625): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4628): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(4809): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(125): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(149): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(149): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(160): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(423): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(594): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(610): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(631): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(631): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(635): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(655): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(659): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(727): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(727): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxdlgs.h(733): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(81): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(82): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(298): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(382): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(384): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(402): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(498): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(514): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(552): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(555): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(773): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(773): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(813): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(819): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(819): error C2061: 语法错误: 标识符“LPCTSTR”


1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(868): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(874): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(881): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(882): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(883): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(884): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(884): error C2061: 语法错误: 标识符“LPCTSTR”
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(886): error C2327: “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数
1>c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxext.h(886): fatal error C1003: 错误计数超过 100;正在停止编译
1>
1>生成失败。
1>
1>已用时间 00:00:02.03
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

[解决办法]
你新建的是mfc的工程么
[解决办法]
没遇到过,话说afxwin.h不是MFC引用的第一个头文件么。。。
[解决办法]
原SDK包是否被你不小心修改过?
[解决办法]
仔细检查你的大妈,c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C2146: 语法错误: 缺少“)”(在标识符“lpszText”的前面)
很明确的说了少),虽然报告是在afxwin.h上,但是一般是在你代码中错误,之所以报告的位置在标准文件上,只是编译器匹配到该位置,无法匹配而已
[解决办法]
新建一个工程看有没有问题,如果没有问题就跟你的工程对比一下
[解决办法]
还要注意是否在输入法状态输入的括号和分号等符号
[解决办法]

引用:
仔细检查你的大妈,c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxwin.h(2651): error C2146: 语法错误: 缺少“)”(在标识符“lpszText”的前面)
很明确的说了少),虽然报告是在afxwin.h上,但是一般是在你代码中错误,之所以报告的位置在标准文件上,只是编译器匹配到该位置,无法匹配而已

同意
楼主需要检查在#include系统头文件之前的代码,该段代码有错导致无法继续包含系统提供的头文件,于是报系统头文件错误
[解决办法]
 “CWnd::LPCTSTR”: 不是类型名称、静态或枚举数

LPCTSTR只是Windows程序中的一个数据类型,为什么要在前面加上“CWnd::”域呢,去掉这个试试吧;
如果不是这个,代码也没问题的话,有时候就是VS2010的问题,清除掉临时文件,再重新打开工程试试。
[解决办法]
可能是更改了SDK内部的文件内容。。

热点排行