home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / MFC / SAMPLES / HELLOAPP / HELLOAPP.CP_ / HELLOAPP.CP
Encoding:
Text File  |  1993-02-08  |  1.1 KB  |  40 lines

  1. // helloapp.cpp : Minimal MFC Windows app.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include <afxwin.h>
  14.  
  15. // Define a window class derived from CFrameWnd
  16. class CHelloWindow : public CFrameWnd
  17. public:
  18.     CHelloWindow() 
  19.         { Create(NULL, "Hello World!", WS_OVERLAPPEDWINDOW, rectDefault); }
  20. };
  21.  
  22. // Define an application class derived from CWinApp
  23. class CHelloApp : public CWinApp
  24. {
  25. public:
  26.     virtual BOOL InitInstance();
  27. };
  28.  
  29. // Construct the CHelloApp's m_pMainWnd data member
  30. BOOL CHelloApp::InitInstance()
  31. {
  32.     m_pMainWnd = new CHelloWindow();
  33.     m_pMainWnd->ShowWindow(m_nCmdShow);
  34.     m_pMainWnd->UpdateWindow();
  35.     return TRUE;
  36. }
  37.  
  38. CHelloApp HelloApp;  // HelloApp's constructor initializes and runs the app
  39.