home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / HELLOAPP.PAK / HELLOAPP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  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-1995 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 related
  9. // electronic 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. {
  18. public:
  19.     CHelloWindow()
  20.         { Create(NULL, _T("Hello World!"), WS_OVERLAPPEDWINDOW, rectDefault); }
  21. };
  22.  
  23. // Define an application class derived from CWinApp
  24. class CHelloApp : public CWinApp
  25. {
  26. public:
  27.     virtual BOOL InitInstance();
  28. };
  29.  
  30. // Construct the CHelloApp's m_pMainWnd data member
  31. BOOL CHelloApp::InitInstance()
  32. {
  33.     m_pMainWnd = new CHelloWindow();
  34.     m_pMainWnd->ShowWindow(m_nCmdShow);
  35.     m_pMainWnd->UpdateWindow();
  36.     return TRUE;
  37. }
  38.  
  39. CHelloApp HelloApp;  // HelloApp's constructor initializes and runs the app
  40.