zoukankan      html  css  js  c++  java
  • First MFC

    // stdafx.h : include file for standard system include files,
    //  or project specific include files that are used frequently, but
    //      are changed infrequently
    //
    
    #if !defined(AFX_STDAFX_H__A3DDEB0A_0CE3_44DE_9AD8_B5AD12758B55__INCLUDED_)
    #define AFX_STDAFX_H__A3DDEB0A_0CE3_44DE_9AD8_B5AD12758B55__INCLUDED_
    
    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    
    #define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
    
    #include <afxwin.h>         // MFC core and standard components
    #include <afxext.h>         // MFC extensions
    #include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
    #ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h>			// MFC support for Windows Common Controls
    #endif // _AFX_NO_AFXCMN_SUPPORT
    
    
    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
    
    #endif // !defined(AFX_STDAFX_H__A3DDEB0A_0CE3_44DE_9AD8_B5AD12758B55__INCLUDED_)
    
    
    /************************************************************/
    // stdafx.cpp : source file that includes just the standard includes
    //	HelloMFC.pch will be the pre-compiled header
    //	stdafx.obj will contain the pre-compiled type information
    
    #include "stdafx.h"
    
    /************************************************************/
    //FileName: hello.h
    
    class CMyApp : public CWinApp
    {
    public:
    	virtual BOOL InitInstance();		
    };
    
    class CMainWindow : public CFrameWnd
    {
    public:
    	CMainWindow();
    protected:
    	afx_msg void OnPaint();
    	DECLARE_MESSAGE_MAP()
    };
    
    
    /************************************************************/
    //FileName: Hello.cpp
    
    #include "StdAfx.h"
    #include "Hello.h"
    
    CMyApp myApp;
    
    //CMyApp
    BOOL CMyApp::InitInstance(){
    	this->m_pMainWnd = new CMainWindow;
    	this->m_pMainWnd->ShowWindow(m_nCmdShow);
    	this->m_pMainWnd->UpdateWindow();
    	return TRUE;
    }
    
    BEGIN_MESSAGE_MAP(CMainWindow,CFrameWnd)
    	ON_WM_PAINT()
    END_MESSAGE_MAP()
    
    //CMainWindow
    CMainWindow::CMainWindow()
    {
    	Create(NULL,_T("The Hello 程序"));
    }
    
    void CMainWindow::OnPaint()
    {
    	CPaintDC dc(this);
    	CRect rect;
    	GetClientRect(&rect);
    	dc.DrawText(_T("Hello,MFC您好!"),-1,&rect,DT_SINGLELINE | DT_CENTER | DT_VCENTER);
    }
    
    
    /************************************************************/
    
  • 相关阅读:
    lsblk---列出所有可用块设备的信息,
    blkid---对系统块设备信息查询
    du---是对文件和目录磁盘使用的空间查看
    strings---对象文件或二进制文件中查找可打印的字符串
    which---查找并显示给定命令的绝对路径
    whereis---定位指令的二进制程序、源代码文件和man手册页等相关文件的路径。
    cd---切换工作目录
    cp---复制文件
    ls---显示文件目录各项信息
    pwd---以绝对路径的方式显示用户当前工作目录
  • 原文地址:https://www.cnblogs.com/wucg/p/3330081.html
Copyright © 2011-2022 走看看