我快疯了,在VS2008没有这个问题,我昨天写了一个自定义控件,上午想把代码拷贝过来用,拷贝过来后编译一下,好多错误,而且我引入的系统级头文件下面都有红下划线,后来找了一下好像VS2010 VC++目录的问题,也没人告诉怎么配,大家来帮帮忙。 24 IntelliSense: 应输入“{” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 26 2 InteractivePlatform
4 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 13 1 InteractivePlatform
10 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 22 1 InteractivePlatform
12 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 24 10 InteractivePlatform
14 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 25 10 InteractivePlatform
16 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 26 10 InteractivePlatform
17 IntelliSense: 无法打开 源 文件 "stdafx.h" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 4 1 InteractivePlatform
18 IntelliSense: 无法打开 源 文件 "InteractivePlatform.h" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 6 1 InteractivePlatform
30 IntelliSense: 未定义标识符 "UINT" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 28 InteractivePlatform
21 IntelliSense: 未定义标识符 "RegisterPanelClass" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 17 2 InteractivePlatform
27 IntelliSense: 未定义标识符 "LPCREATESTRUCT" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 65 22 InteractivePlatform
7 IntelliSense: 未定义标识符 "HWND" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 25 InteractivePlatform
33 IntelliSense: 未定义标识符 "HWND" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 32 InteractivePlatform
20 IntelliSense: 未定义标识符 "CWnd" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 13 27 InteractivePlatform
23 IntelliSense: 未定义标识符 "CWnd" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 25 27 InteractivePlatform
31 IntelliSense: 未定义标识符 "CPoint" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 41 InteractivePlatform
5 IntelliSense: 未定义标识符 "CBrush" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 16 2 InteractivePlatform
8 IntelliSense: 未定义标识符 "BYTE" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 35 InteractivePlatform
34 IntelliSense: 未定义标识符 "BYTE" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 42 InteractivePlatform
6 IntelliSense: 未定义标识符 "BOOL" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 2 InteractivePlatform
32 IntelliSense: 未定义标识符 "BOOL" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 1 InteractivePlatform
3 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 11 2 InteractivePlatform
9 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 21 2 InteractivePlatform
19 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 13 1 InteractivePlatform
22 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 25 1 InteractivePlatform
11 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 24 2 InteractivePlatform
13 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 25 2 InteractivePlatform
15 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 26 2 InteractivePlatform
2 IntelliSense: 不是类名或结构名 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 9 23 InteractivePlatform
25 IntelliSense: class "CPanel" 没有成员 "RegisterPanelClass" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 38 14 InteractivePlatform
28 IntelliSense: class "CPanel" 没有成员 "OnPaint" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 79 14 InteractivePlatform
29 IntelliSense: class "CPanel" 没有成员 "OnLButtonDown" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 14 InteractivePlatform
26 IntelliSense: class "CPanel" 没有成员 "OnCreate" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 65 13 InteractivePlatform
4 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 13 1 InteractivePlatform
10 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 22 1 InteractivePlatform
12 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 24 10 InteractivePlatform
14 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 25 10 InteractivePlatform
16 IntelliSense: 应输入“;” d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 26 10 InteractivePlatform
17 IntelliSense: 无法打开 源 文件 "stdafx.h" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 4 1 InteractivePlatform
18 IntelliSense: 无法打开 源 文件 "InteractivePlatform.h" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 6 1 InteractivePlatform
30 IntelliSense: 未定义标识符 "UINT" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 28 InteractivePlatform
21 IntelliSense: 未定义标识符 "RegisterPanelClass" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 17 2 InteractivePlatform
27 IntelliSense: 未定义标识符 "LPCREATESTRUCT" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 65 22 InteractivePlatform
7 IntelliSense: 未定义标识符 "HWND" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 25 InteractivePlatform
33 IntelliSense: 未定义标识符 "HWND" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 32 InteractivePlatform
20 IntelliSense: 未定义标识符 "CWnd" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 13 27 InteractivePlatform
23 IntelliSense: 未定义标识符 "CWnd" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 25 27 InteractivePlatform
31 IntelliSense: 未定义标识符 "CPoint" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 41 InteractivePlatform
5 IntelliSense: 未定义标识符 "CBrush" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 16 2 InteractivePlatform
8 IntelliSense: 未定义标识符 "BYTE" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 35 InteractivePlatform
34 IntelliSense: 未定义标识符 "BYTE" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 42 InteractivePlatform
6 IntelliSense: 未定义标识符 "BOOL" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 18 2 InteractivePlatform
32 IntelliSense: 未定义标识符 "BOOL" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 175 1 InteractivePlatform
3 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 11 2 InteractivePlatform
9 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 21 2 InteractivePlatform
19 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 13 1 InteractivePlatform
22 IntelliSense: 缺少显式类型(假定“int”) d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 25 1 InteractivePlatform
11 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 24 2 InteractivePlatform
13 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 25 2 InteractivePlatform
15 IntelliSense: 此声明没有存储类或类型说明符 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 26 2 InteractivePlatform
2 IntelliSense: 不是类名或结构名 d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.h 9 23 InteractivePlatform
25 IntelliSense: class "CPanel" 没有成员 "RegisterPanelClass" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 38 14 InteractivePlatform
28 IntelliSense: class "CPanel" 没有成员 "OnPaint" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 79 14 InteractivePlatform
29 IntelliSense: class "CPanel" 没有成员 "OnLButtonDown" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 98 14 InteractivePlatform
26 IntelliSense: class "CPanel" 没有成员 "OnCreate" d:\dd\work\20100307\interactiveplatform\coustomcontrol\panel.cpp 65 13 InteractivePlatform
你确定你的工程在 VS2008能正常编译运行?你不要把代码拷贝到 VS2010 啊,你直接用 2010 打开那个VS2008能正常编译的工程,让它转换为 2010的工程,再编译,不就行了么?干嘛非得把代码拷贝过来啊?
工具->选项->项目-》VC++目录 库文件,添加你的库文件目录如果是头文件,可以在项目-》属性-》常规, 附加包含目录, 添加你的头文件目录
你拷贝的是整个 cpp 文件还是拷贝其中的函数?要是拷贝函数的话,除非你这个函数里用到了别的类里面的变量什么的,如果拷贝的这个函数是与外界文件无关(除了形参),那么这样拷贝过去,肯定不会出问题的撒
好像是文件 Demo2Dlg.cpp 开头少包含了那个 #include "StdAfx.h"
在“工具”菜单上,单击“选项”。选择“文本编辑器”文件夹。选择用于要自定义 Intellisense 的语言的文件夹。