error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

romeany 2009-04-16 03:43:50
class CPortScanDlg : public CDialog
{
DECLARE_DYNAMIC(CPortScanDlg)

public:
CPortScanDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~CPortScanDlg();

// 对话框数据
enum { IDD = IDD_PORTSCAN_DLG };

protected:

//Adds a new item to m_cResult
AddItem( int nItem,int nSubItem,LPCTSTR strItem,int nImageIndex = -1);// 错误位置 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
BOOL TestConnection(CString IP, UINT nPort);
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持

afx_msg void OnBnClickedStart();
afx_msg void OnBnClickedStop();
afx_msg void OnBnClickedRadioone();
afx_msg void OnBnClickedRadiomany();
DECLARE_MESSAGE_MAP()
public:
CPtrList* m_pStatusList;//Our link list. The nodes are in type DATA*. See the above structure
CIPAddressCtrl m_ctrlIPAddr;
CEdit m_ctrlOne;
CEdit m_ctrlFrom;
CEdit m_ctrlTo;
CEdit m_ctrlTime;
CListCtrl m_ctrlListResult;
CProgressCtrl m_ctrlProgress;
bool m_nPortOne;
UINT m_minPort,m_maxPort; //Lower bound and upper bound of scanning ports range
UINT m_nCounter;
//Maximum attempts to connect a socket
UINT m_nMaxAttempts;
virtual BOOL OnInitDialog();
CButton m_ctrlBtnStart;
CButton m_ctrlBtnStop;
CStatic m_ctrlStatus;
};

请问各位怎么解决这问题呀?
...全文
66756 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
如斯光年 2011-11-21
  • 打赏
  • 举报
回复
解决了没?
风火连城 2011-09-03
  • 打赏
  • 举报
回复
我的编译环境VS2005,果断加返回值类型就行了,受教了!
wanglei5695312 2010-03-12
  • 打赏
  • 举报
回复
果然厉害,学习了
minmin1115 2009-08-24
  • 打赏
  • 举报
回复
修改工程属性 或文件属性c/c - advanced - compile as 为 Compile as C Code (/TC)
xiaomatian 2009-07-07
  • 打赏
  • 举报
回复
申明函数时候需要指定返回类型,如果你不需要返回数据则申明为void ***()

VC6可能可以通过,但是08下默认是绝对不行的。
阿六_Dexter 2009-07-02
  • 打赏
  • 举报
回复
你函数 没有返回值 C 里面是默认返回int, C++ 比较严谨 必须要写返回值
handry_365 2009-06-29
  • 打赏
  • 举报
回复

1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1463) : error C2371: “FontPtr”: 重定义;不同的基类型
1> c:\program files\microsoft visual studio 8\vc\include\comdef.h(312) : 参见“FontPtr”的声明
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1541) : error C2786: “BOOL (__stdcall *)(HDC,int,int,int,int)”: __uuidof 的操作数无效
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1541) : error C2923: “_com_IIID”:“Rectangle”不是参数“_Interface”的有效 模板 类型变量
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(3514) : 参见“Rectangle”的声明
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1541) : error C3203: “_com_IIID”: 未专用化的类 模板 不能用作 模板 变量,该变量属于 模板 参数“_IIID”,应为 real 类型
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1545) : error C2786: “BOOL (__stdcall *)(HDC,int,int,int,int,int,int,int,int)”: __uuidof 的操作数无效
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1545) : error C2923: “_com_IIID”:“Arc”不是参数“_Interface”的有效 模板 类型变量
1> c:\program files\microsoft visual studio 8\vc\platformsdk\include\wingdi.h(2765) : 参见“Arc”的声明
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1545) : error C3203: “_com_IIID”: 未专用化的类 模板 不能用作 模板 变量,该变量属于 模板 参数“_IIID”,应为 real 类型
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(1552) : error C2371: “PicturePtr”: 重定义;不同的基类型
1> c:\program files\microsoft visual studio 8\vc\include\comdef.h(326) : 参见“PicturePtr”的声明
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2034) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2076) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2178) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2197) : error C2146: 语法错误 : 缺少“;”(在标识符“GetRGB”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2197) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2197) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2197) : warning C4183: “GetRGB”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2199) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2218) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2220) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2239) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2369) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2408) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2491) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2541) : error C2146: 语法错误 : 缺少“;”(在标识符“GetTransparencyColor”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2541) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2541) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2541) : warning C4183: “GetTransparencyColor”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2543) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2587) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2589) : error C2061: 语法错误 : 标识符“MsoRGBType”
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2598) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2719) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(2837) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3098) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3132) : error C2146: 语法错误 : 缺少“;”(在标识符“GradientStops”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3132) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3132) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3190) : error C2146: 语法错误 : 缺少“;”(在标识符“GetGradientStops”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3190) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3190) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3190) : warning C4183: “GetGradientStops”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3384) : error C2504: “_IMsoDispObj”: 未定义基类
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3404) : error C2146: 语法错误 : 缺少“;”(在标识符“TextRange”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3404) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3404) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3406) : error C2146: 语法错误 : 缺少“;”(在标识符“Column”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3406) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3406) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3408) : error C2146: 语法错误 : 缺少“;”(在标识符“Ruler”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3408) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3408) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3453) : error C2146: 语法错误 : 缺少“;”(在标识符“GetTextRange”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3453) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3453) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3453) : warning C4183: “GetTextRange”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3454) : error C2146: 语法错误 : 缺少“;”(在标识符“GetColumn”的前面)
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3454) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3454) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\specture projects code\second try 090629\withexcel\withexcel\debug\excel.tlh(3454) : warning C4183: “GetColumn”: 缺少返回类型;假定为返回“int”的成员函数

这么一大堆的错误是怎么回事呢?
求教啊~
真相重于对错 2009-04-28
  • 打赏
  • 举报
回复
AddItem( int nItem,int nSubItem,LPCTSTR strItem,int nImageIndex = -1);// 错误位
????????
返回类型
saltell 2009-04-28
  • 打赏
  • 举报
回复
找到出事的语句,看看变量的类型是不是有问题...
  • 打赏
  • 举报
回复
AddItem这个函数没有返回值,要显示声明返回值
比如 int AddItem(...)
网上下载了emule0.50a-Xtreme8.1-sources源码,声称可以在VS2008下直接编译成功,经我实际测试,系统会报错,其中第一类错误,由于系统中为了兼容VISTA/WIN7,增加了相关定义,而这些定义在XP/WIN2003环境下会报错,共771个错误,如: 错误 2 error C2065: “ITaskbarList3”: 未声明的标识符 d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 195 emule 错误 3 error C2146: 语法错误 : 缺少“;”(在标识符“m_thbButtons”的前面) d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 196 emule 错误 4 error C4430: 缺少类型说明符 - 假定int注意: C++支持默认 int d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 196 emule 错误 5 error C4430: 缺少类型说明符 - 假定int注意: C++支持默认 int d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 196 emule 错误 6 error C2146: 语法错误 : 缺少“;”(在标识符“m_currentTBP_state”的前面) d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 198 emule 错误 7 error C4430: 缺少类型说明符 - 假定int注意: C++支持默认 int d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 198 emule 错误 8 error C4430: 缺少类型说明符 - 假定int注意: C++支持默认 int d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 198 emule 错误 10 error C2065: “ITaskbarList3”: 未声明的标识符 d:\emule相关资料\emule0.50a-xtreme\emule0.50a-xtreme8.1-sources\srchybrid\emuleDlg.h 195 emule ...... 此类错误中,ITaskbarList3是VISTA/WIN7环境下与任务栏相关的变量,只要屏闭掉相关定义就能正常。 除此之外还报有下面 5 个错误(实际引起错误的位置只有两个): 错误 135 error C2059: 语法错误 : “:” d:\eMule\srchybrid\BaseClient.cpp 1603 emule 错误 136 error C2065: “tagName”: 未声明的标识符 d:\eMule\srchybrid\BaseClient.cpp 1604 emule 错误 137 error C2228: “.WriteTagToFile”的左边必须有类/结构/联合 d:\eMule\srchybrid\BaseClient.cpp 1604 emule 错误 139 error C2001: 常量中有换行符 d:\eMule\srchybrid\BaseClient.cpp 4832 emule 错误 140 fatal error C1057: 宏展开中遇到意外的文件结束 d:\eMule\srchybrid\BaseClient.cpp 4832 emule 此类错误中,实际上是是两个语法错误,由于太过简单,我与网友都怀疑是作者故意制造的错误,若是完全不懂C++的人,即使拿到源码,编也会报错,从而止步于此。而稍懂C++的人(本人即是此类菜鸟),则可以找出错误之处。 为方便诸多象我一样的初学者,我把修正之后,可以在 XP/WIN2003 +VS2003SP1 环境下直接编译成功的emule0.50a-Xtreme8.1-sources源码发布上来,以便互相学习交流。

7,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧