| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1143 人关注过本帖
标题:VC6.0中添加新类问题 |有图片说明
取消只看楼主 加入收藏
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
 问题点数:0 回复次数:6 
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
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册


2007-10-28 22:45
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
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 

看来解决不了了


2007-10-28 23:48
ding_inshili
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2007-9-13
收藏
得分:0 
谢谢楼上的小姐,请问贵姓,交个朋友...

再谢!!!!!!!!!,我太麻痹大意了。

2007-10-29 07:36
快速回复:VC6.0中添加新类问题 |有图片说明
数据加载中...
 
   



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

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