www.pudn.com > kugong.rar > pjt.cpp
// pjt.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "pjt.h"
#include "pjtDlg.h"
#include "MyWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPjtApp
BEGIN_MESSAGE_MAP(CPjtApp, CWinApp)
//{{AFX_MSG_MAP(CPjtApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CPjtApp construction
CPjtApp::CPjtApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CPjtApp object
CPjtApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CPjtApp initialization
BOOL CPjtApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
//建立主窗口
CMyWnd* myFrame = new CMyWnd;
m_pMainWnd = myFrame;
//取得屏幕大小的矩形区域
CRect rect(0, 0, GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CXFULLSCREEN));
myFrame->CreateMyWnd("BAIBAN", rect);//建立窗口
myFrame->CenterWindow(); //窗口居中
myFrame->ShowWindow(SW_SHOW); //显示窗口
return TRUE;
}