MFC添加析构函数声明和定义的具体方法?
工程名为Chat,先看CChat.h//Chat.h:mainheaderfilefortheCHATapplication//#if!defined(AFX_CHAT_...
工程名为Chat,先看CChat.h
// Chat.h : main header file for the CHAT application
//
#if !defined(AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_)
#define AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CChatApp:
// See Chat.cpp for the implementation of this class
//
class CChatApp : public CWinApp
{
public:
CChatApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChatApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CChatApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_)
以上是对话框默认的头文件内容,再看源文件
#include......
/////////////////////////////////////////////////////////////////////////////
// CChatApp
BEGIN_MESSAGE_MAP(CChatApp, CWinApp)
//{{AFX_MSG_MAP(CChatApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChatApp construction
CChatApp::CChatApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
//我就是想知道~CChatApp析构的声明和定义写在哪里,具体位置和格式
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CChatApp object
CChatApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CChatApp initialization
BOOL CChatApp::InitInstance()
{.... 展开
// Chat.h : main header file for the CHAT application
//
#if !defined(AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_)
#define AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CChatApp:
// See Chat.cpp for the implementation of this class
//
class CChatApp : public CWinApp
{
public:
CChatApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChatApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CChatApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHAT_H__05419E50_FFF9_4CB1_B328_6F33D0728E79__INCLUDED_)
以上是对话框默认的头文件内容,再看源文件
#include......
/////////////////////////////////////////////////////////////////////////////
// CChatApp
BEGIN_MESSAGE_MAP(CChatApp, CWinApp)
//{{AFX_MSG_MAP(CChatApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChatApp construction
CChatApp::CChatApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
//我就是想知道~CChatApp析构的声明和定义写在哪里,具体位置和格式
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CChatApp object
CChatApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CChatApp initialization
BOOL CChatApp::InitInstance()
{.... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询