关于MFC背景知识问题 我想问问MFC的源代码都是公开的吗如果我想看CObject类的构造函数的源代码 能看到吗我说是真真的源代码不是那些所谓的H头声明 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SRC目录下不是还有些CPP文件的吗 “\Microsoft Visual Studio\VC98\MFC\SRC”下可看到部分东西,不过可没有CObject哟 连CString都只能找到部分成员函数的实现 //afx.hclass 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// Attributespublic: 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// Implementationpublic: static const CRuntimeClass classCObject;#ifdef _AFXDLL static CRuntimeClass* PASCAL GetThisClass();#endif};//afx.inl#ifdef _AFX_INLINE// CObject_AFX_INLINE CObject::CObject() { }_AFX_INLINE CObject::~CObject() { }_AFX_INLINE void CObject::Serialize(CArchive&) { /* CObject does not serialize anything by default */ }_AFX_INLINE void* PASCAL CObject::operator new(size_t, void* p) { return p; }#ifndef _DEBUG// _DEBUG versions in afxmem.cpp_AFX_INLINE void PASCAL CObject::operator delete(void* p) { ::operator delete(p); }#if _MSC_VER >= 1200_AFX_INLINE void PASCAL CObject::operator delete(void* p, void*) { ::operator delete(p); }#endif_AFX_INLINE void* PASCAL CObject::operator new(size_t nSize) { return ::operator new(nSize); }// _DEBUG versions in objcore.cpp#ifdef _AFXDLL_AFX_INLINE void CObject::AssertValid() const { /* no asserts in release builds */ }_AFX_INLINE void CObject::Dump(CDumpContext&) const { /* no dumping in release builds */ }#endif //_AFXDLL#endif //!_DEBUG_AFX_INLINE const CObject* AFX_CDECL AfxDynamicDownCast(CRuntimeClass* pClass, const CObject* pObject) { return (const CObject*)AfxDynamicDownCast(pClass, (CObject*)pObject); }#ifdef _DEBUG_AFX_INLINE const CObject* AFX_CDECL AfxStaticDownCast(CRuntimeClass* pClass, const CObject* pObject) { return (const CObject*)AfxStaticDownCast(pClass, (CObject*)pObject); }#endif 关于MFC CTreeCtrl 的scroll bar 写了一个ie的控件,类似工具条,它可以设置ie的代理。但是如何实现socks代理? 串口问题求助,急。。。。。(顶者有分) 网吧管理系统怎么搞呀! 想在对话框窗体上一块固定大小区域播放FLASH,如何实现 存储HBITMAP到BMP文件出错(附源码) 请提供"Visual C++网络通信编程实用案例精选"下载地址,谢谢! 如何捕获控制台的输出? 如何禁止改变窗口的大小?在线等。 高级技术问题1:线程控制机制的设计 菜单项控制 在listbox的SELCHANGE消息处理函数中如何获取上一个选定的item?
{
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 GetThisClass();
#endif
};
//afx.inl#ifdef _AFX_INLINE// CObject
_AFX_INLINE CObject::CObject()
{ }
_AFX_INLINE CObject::~CObject()
{ }
_AFX_INLINE void CObject::Serialize(CArchive&)
{ /* CObject does not serialize anything by default */ }
_AFX_INLINE void* PASCAL CObject::operator new(size_t, void* p)
{ return p; }
#ifndef _DEBUG
// _DEBUG versions in afxmem.cpp
_AFX_INLINE void PASCAL CObject::operator delete(void* p)
{ ::operator delete(p); }
#if _MSC_VER >= 1200
_AFX_INLINE void PASCAL CObject::operator delete(void* p, void*)
{ ::operator delete(p); }
#endif
_AFX_INLINE void* PASCAL CObject::operator new(size_t nSize)
{ return ::operator new(nSize); }
// _DEBUG versions in objcore.cpp
#ifdef _AFXDLL
_AFX_INLINE void CObject::AssertValid() const
{ /* no asserts in release builds */ }
_AFX_INLINE void CObject::Dump(CDumpContext&) const
{ /* no dumping in release builds */ }
#endif //_AFXDLL
#endif //!_DEBUG
_AFX_INLINE const CObject* AFX_CDECL AfxDynamicDownCast(CRuntimeClass* pClass, const CObject* pObject)
{ return (const CObject*)AfxDynamicDownCast(pClass, (CObject*)pObject); }
#ifdef _DEBUG
_AFX_INLINE const CObject* AFX_CDECL AfxStaticDownCast(CRuntimeClass* pClass, const CObject* pObject)
{ return (const CObject*)AfxStaticDownCast(pClass, (CObject*)pObject); }
#endif