home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / general / vcterm / candlg.cpp next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.6 KB  |  67 lines

  1. // candlg.cpp : implementation of the CCancelDlg class
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "vcterm.h"
  16. #include "CanDlg.h"
  17.  
  18. #include "mainfrm.h"
  19.  
  20. #ifdef _DEBUG
  21. #define new DEBUG_NEW
  22. #undef THIS_FILE
  23. static char THIS_FILE[] = __FILE__;
  24. #endif
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CCancelDlg dialog
  28.  
  29.  
  30. CCancelDlg::CCancelDlg(CWnd* pParent /*=NULL*/)
  31.     : CDialog(CCancelDlg::IDD, pParent)
  32. {
  33.     //{{AFX_DATA_INIT(CCancelDlg)
  34.         // NOTE: the ClassWizard will add member initialization here
  35.     //}}AFX_DATA_INIT
  36. }
  37.  
  38.  
  39. void CCancelDlg::DoDataExchange(CDataExchange* pDX)
  40. {
  41.     CDialog::DoDataExchange(pDX);
  42.     //{{AFX_DATA_MAP(CCancelDlg)
  43.         // NOTE: the ClassWizard will add DDX and DDV calls here
  44.     //}}AFX_DATA_MAP
  45. }
  46.  
  47.  
  48. BEGIN_MESSAGE_MAP(CCancelDlg, CDialog)
  49.     //{{AFX_MSG_MAP(CCancelDlg)
  50.     //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CCancelDlg message handlers
  55.  
  56. void CCancelDlg::OnCancel()
  57. {
  58.     // Signal MainFrame window to cease transmitting data.
  59.     ((CMainFrame*)GetParent())->m_bCancel = TRUE;
  60.     DestroyWindow();
  61. }
  62.  
  63. void CCancelDlg::PostNcDestroy()
  64. {
  65.     delete this;
  66. }
  67.