CObject类

class AFX_NOVTABLE CObject
{
public:

// Object model (types, destruction, allocation)
     virtual CRuntimeClass* GetRuntimeClass() const;
     virtual ~CObject() = 0;  // virtual destructors are necessary

 // Diagnostic allocations
     void* PASCAL operator new(size_t nSize);
     void* PASCAL operator new(size_t, void* p);
     void PASCAL operator delete(void* p);
#if _MSC_VER >= 1200
     void PASCAL operator delete(void* p, void* pPlace);
#endif

#if defined(_DEBUG) && !defined(_AFX_NO_DEBUG_CRT)
 // for file name/line number tracking using DEBUG_NEW
     void* PASCAL operator new(size_t nSize, LPCSTR lpszFileName, int nLine);
#if _MSC_VER >= 1200
     void PASCAL operator delete(void *p, LPCSTR lpszFileName, int nLine);
#endif
#endif

 // Disable the copy constructor and assignment by default so you will get
 //   compiler errors instead of unexpected behaviour if you pass objects
 //   by value or assign objects.
protected:
     CObject();
private:
     CObject(const CObject& objectSrc);              // no implementation
     void operator=(const CObject& objectSrc);       // no implementation

// Attributes
public:
     BOOL IsSerializable() const;
     BOOL IsKindOf(const CRuntimeClass* pClass) const;

// Overridables
     virtual void Serialize(CArchive& ar);

#if defined(_DEBUG) || defined(_AFXDLL)
 // Diagnostic Support
     virtual void AssertValid() const;
     virtual void Dump(CDumpContext& dc) const;
#endif

// Implementation
public:
     static const CRuntimeClass classCObject;
#ifdef _AFXDLL
     static CRuntimeClass* PASCAL _GetBaseClass();
     static CRuntimeClass* PASCAL GetThisClass();
#endif
};
 此结构存在于头文件afx.h中。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值