注册 登录
编程论坛 VC++/MFC

win32项目窗口不显示,程序没报错.

yang0401 发布于 2013-07-04 16:13, 542 次点击
程序代码:
// cAPP.cpp: implementation of the cAPP class.
//
//////////////////////////////////////////////////////////////////////
#include "c3.h"
#include "cAPP.h"
#include "cwnd.h"


#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cAPP myapp;
bool cAPP::initi()
{
    m_pMainWnd=new cwnd;
    m_pMainWnd->ShowWindow(m_nCmdShow);
    m_pMainWnd->UpdateWindow();
    return true;
}
cAPP::cAPP()
{
}

cAPP::~cAPP()
{

}
            
程序代码:
// cwnd.cpp : implementation file
//

#include "stdafx.h"
#include "c3.h"
#include "cwnd.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// cwnd

IMPLEMENT_DYNCREATE(cwnd, CFrameWnd)

cwnd::cwnd()
{
    Create(NULL,"创建窗口");
}

cwnd::~cwnd()
{
}


BEGIN_MESSAGE_MAP(cwnd, CFrameWnd)
    //{{AFX_MSG_MAP(cwnd)
        
// NOTE - the ClassWizard will add and remove mapping macros here.
   
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// cwnd message handlers// cAPP.h: interface for the cAPP class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CAPP_H__B1F8C74B_C698_4833_B022_A877826986CB__INCLUDED_)
#define AFX_CAPP_H__B1F8C74B_C698_4833_B022_A877826986CB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class cAPP : public CWinApp
{
public:
    bool initi();
    cAPP();
    virtual ~cAPP();

};

#endif // !defined(AFX_CAPP_H__B1F8C74B_C698_4833_B022_A877826986CB__INCLUDED_)#if !defined(AFX_CWND_H__9CD26217_CE16_46B8_A44F_A6EC6307293D__INCLUDED_)
#define AFX_CWND_H__9CD26217_CE16_46B8_A44F_A6EC6307293D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// cwnd.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// cwnd frame

class cwnd : public CFrameWnd
{
    DECLARE_DYNCREATE(cwnd)
public:
    cwnd();           // protected constructor used by dynamic creation

// Attributes
public:

// Operations
public:

// Overrides
   
// ClassWizard generated virtual function overrides
   
//{{AFX_VIRTUAL(cwnd)
   
//}}AFX_VIRTUAL

// Implementation
protected:
    virtual ~cwnd();

    // Generated message map functions
   
//{{AFX_MSG(cwnd)
        
// NOTE - the ClassWizard will add and remove member functions here.
   
//}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CWND_H__9CD26217_CE16_46B8_A44F_A6EC6307293D__INCLUDED_)





[ 本帖最后由 yang0401 于 2013-7-4 16:16 编辑 ]
2 回复
#2
yang04012013-07-04 16:14
程序应该显示一个窗口的,结果运行了一点反应都没有。
#3
yuccn2013-07-04 20:40
把程序发出来
1