home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / appwiz / logowiz / template / pressdlg.cpp < prev    next >
C/C++ Source or Header  |  1998-03-05  |  1KB  |  49 lines

  1. // pressdlg.cpp : implementation file
  2. //
  3. // This class looks a whole lot like the one in MFC sample ctrltest
  4. // with a few name changes.  It is included here as an example of
  5. // how to add additional classes during app creation from a custom
  6. // AppWizard.
  7. //
  8. // This is a part of the Microsoft Foundation Classes C++ library.
  9. // Copyright (C) 1995 Microsoft Corporation
  10. // All rights reserved.
  11. //
  12. // This source code is only intended as a supplement to the
  13. // Microsoft Foundation Classes Reference and Microsoft
  14. // WinHelp documentation provided with the library.
  15. // See these sources for detailed information regarding the
  16. // Microsoft Foundation Classes product.
  17.  
  18. #include "stdafx.h"
  19. #include "resource.h"
  20. #include "pressdlg.h"
  21.  
  22. BEGIN_MESSAGE_MAP(CPressMeDlg, CDialog)
  23.     //{{AFX_MSG_MAP(CPressMeDlg)
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27.  
  28. CPressMeDlg::CPressMeDlg()
  29.     : CDialog(CPressMeDlg::IDD)
  30. {
  31.     if (!m_buttonOk.LoadBitmaps(IDB_SMILE_UP, IDB_SMILE_DOWN, IDB_SMILE_FOCUS) ||
  32.         !m_buttonCancel.LoadBitmaps(IDB_FROWN_UP, IDB_FROWN_DOWN, IDB_FROWN_FOCUS))
  33.     {
  34.         TRACE0("Failed to load bitmaps for buttons\n");
  35.         AfxThrowResourceException();
  36.     }
  37. }
  38.  
  39. BOOL CPressMeDlg::OnInitDialog()
  40. {
  41.     // each dialog control has special bitmaps
  42.     VERIFY(m_buttonOk.SubclassDlgItem(IDOK, this));
  43.     m_buttonOk.SizeToContent();
  44.     VERIFY(m_buttonCancel.SubclassDlgItem(IDCANCEL, this));
  45.     m_buttonCancel.SizeToContent();
  46.  
  47.     return TRUE;
  48. }
  49.