| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 542 人关注过本帖
标题:win32项目窗口不显示,程序没报错.
只看楼主 加入收藏
yang0401
Rank: 2
等 级:论坛游民
帖 子:84
专家分:57
注 册:2011-5-23
结帖率:69.23%
收藏
已结贴  问题点数:10 回复次数:2 
win32项目窗口不显示,程序没报错.
程序代码:
// 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 编辑 ]
搜索更多相关主题的帖子: 项目 
2013-07-04 16:13
yang0401
Rank: 2
等 级:论坛游民
帖 子:84
专家分:57
注 册:2011-5-23
收藏
得分:0 
程序应该显示一个窗口的,结果运行了一点反应都没有。
2013-07-04 16:14
yuccn
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:何方
等 级:版主
威 望:167
帖 子:6815
专家分:42393
注 册:2010-12-16
收藏
得分:10 
把程序发出来

我行我乐
公众号:逻辑客栈
我的博客:
https://blog.yuccn. net
2013-07-04 20:40
快速回复:win32项目窗口不显示,程序没报错.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013389 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved