| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1139 人关注过本帖
标题:VC6.0中添加新类问题 |有图片说明
只看楼主 加入收藏
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
 问题点数:0 回复次数:10 
VC6.0中添加新类问题 |有图片说明

我在工程中添加新的类的时候出现错误,具体情况描述如下:
1,要添加的类为:class CDisplayThread: public CExampleThread
其中CExampleThread是工程中的类(CExampleThread 由CWinThread派生而来)
2, 现在我需要添加1所说的类(在CExampleThread.h中添加的),但是手动添加后,运行出现错误,具体如下图所示。
不知是怎么回事,请高手指点!!!

搜索更多相关主题的帖子: 工程 class public 
2007-10-28 22:11
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 
[IMG]f://class.bmp[/IMG]

2007-10-28 22:13
Janlex
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:303
专家分:0
注 册:2006-9-12
收藏
得分:0 
图?

★★★★★欢迎光临我的博客 ★★★★★
http://www.
2007-10-28 22:24
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册


2007-10-28 22:45
Janlex
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:303
专家分:0
注 册:2006-9-12
收藏
得分:0 
把ExampleThread.cpp文件的第11行和17行代码贴出来.
再把出错完整提示信息贴出来

★★★★★欢迎光临我的博客 ★★★★★
http://www.
2007-10-28 22:50
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 

// ExampleThread.cpp : implementation file
//

#include "stdafx.h"
#include "MultiThread.h"
#include "ExampleThread.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CExampleThread

IMPLEMENT_DYNCREATE(CExampleThread, CWinThread)

CExampleThread::CExampleThread()
{
}

CExampleThread::~CExampleThread()
{
}

BOOL CExampleThread::InitInstance()
{
// TODO: perform and per-thread initialization here
return TRUE;
}

int CExampleThread::ExitInstance()
{
// TODO: perform any per-thread cleanup here
return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CExampleThread, CWinThread)
//{{AFX_MSG_MAP(CExampleThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExampleThread message handlers


2007-10-28 22:59
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 

错误信息

--------------------Configuration: MultiThread - Win32 Debug--------------------
Compiling...
ExampleThread.cpp
F:\MultiThread\ExampleThread.cpp(11) : error C2628: 'CDisplayThread' followed by 'char' is illegal (did you forget a ';'?)
F:\MultiThread\ExampleThread.cpp(11) : error C2538: new : cannot specify initializer for arrays
F:\MultiThread\ExampleThread.cpp(17) : error C2665: 'new' : none of the 3 overloads can convert parameter 2 from type 'class CDisplayThread []'
Error executing cl.exe.

MultiThread.exe - 3 error(s), 0 warning(s)


2007-10-28 23:01
Janlex
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:303
专家分:0
注 册:2006-9-12
收藏
得分:0 

看了下,我也不知道问题出在哪
等高手来解决吧


★★★★★欢迎光临我的博客 ★★★★★
http://www.
2007-10-28 23:25
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 

看来解决不了了


2007-10-28 23:48
yeshirow
Rank: 4
等 级:贵宾
威 望:10
帖 子:854
专家分:0
注 册:2006-6-8
收藏
得分:0 
回复:(ding_inshili)VC6.0中添加新类问题 |有图片说...

Did you forget a ";"?

class ...
{

...
}; //<- ;


原來朋友仔感情再天真, 亦是我永遠也會愛惜的人, 明日愛他人, 也記住學會不要緊; 原來朋友比戀人更高分, 亦讓我開始懂得不記恨, 若大家都敏感, 我更要永遠記得拒絕再因小事怪人, 爲何沒有這條校訓...Twins-朋友仔 MCSD Training
2007-10-29 00:44
快速回复:VC6.0中添加新类问题 |有图片说明
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017715 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved