我在创建一个新类CClientSocket的时候 以CSocket为基类,在没有添加任何参数的情况下编译(即以创建完新类的时候就编译)
程序就会报错;偶是菜鸟,请各位高手帮帮忙,还有我要创建一个以CObject为基类的新类,不过我在添加新类向导里面没有发现有CObject这个基类 ,
CClientSocket类的头文件代码如下:
#if !defined(AFX_CLIENTSOCKET_H__7F3CCAE9_3918_4A1B_9F05_AC00E19F1202__INCLUDED_)
#define AFX_CLIENTSOCKET_H__7F3CCAE9_3918_4A1B_9F05_AC00E19F1202__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ClientSocket.h : header file
///////////////////////////////////////////////////////////////////////////////
// CClientSocket command targetclass CClientSocket : public CSocket
{

// Attributes
public:// Operations
public:
CClientSocket();
virtual ~CClientSocket();// Overrides
public:
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CClientSocket)
//}}AFX_VIRTUAL // Generated message map functions
//{{AFX_MSG(CClientSocket)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG// Implementation
protected:
};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CLIENTSOCKET_H__7F3CCAE9_3918_4A1B_9F05_AC00E19F1202__INCLUDED_)编译时出错代码如下:
--------------------Configuration: CClient - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
CClient.cpp
MainFrm.cpp
CClientDoc.cpp
CClientView.cpp
CntrItem.cpp
ClientSocket.cpp
d:\program files\microsoft visual studio\myprojects\cclient\clientsocket.h(16) : error C2504: 'CSocket' : base class undefined
Generating Code...
执行 cl.exe 时出错.CClient.exe - 1 error(s), 0 warning(s)