home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / NETTOOLS.ZIP / nettools.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-30  |  3.4 KB  |  133 lines

  1. // nettools.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "nettools.h"
  6. #include "MainFrm.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CNettoolsApp
  16.  
  17. BEGIN_MESSAGE_MAP(CNettoolsApp, CWinApp)
  18.     //{{AFX_MSG_MAP(CNettoolsApp)
  19.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  20.         // NOTE - the ClassWizard will add and remove mapping macros here.
  21.         //    DO NOT EDIT what you see in these blocks of generated code!
  22.     //}}AFX_MSG_MAP
  23.     // Standard file based document commands
  24.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  25.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  26.     // Standard print setup command
  27.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  28. END_MESSAGE_MAP()
  29.  
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CNettoolsApp construction
  32.  
  33. CNettoolsApp::CNettoolsApp()
  34. {
  35.     // TODO: add construction code here,
  36.     // Place all significant initialization in InitInstance
  37. }
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // The one and only CNettoolsApp object
  41.  
  42. CNettoolsApp theApp;
  43.  
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CNettoolsApp initialization
  46.  
  47. BOOL CNettoolsApp::InitInstance()
  48. {
  49.     // Standard initialization
  50.     // If you are not using these features and wish to reduce the size
  51.     //  of your final executable, you should remove from the following
  52.     //  the specific initialization routines you do not need.
  53.  
  54. #ifdef _AFXDLL
  55.     Enable3dControls();            // Call this when using MFC in a shared DLL
  56. #else
  57.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  58. #endif
  59.  
  60.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  61.  
  62.     // Register the application's document templates.  Document templates
  63.     //  serve as the connection between documents, frame windows and views.
  64.  
  65.     CMainFrame * pFrame = new CMainFrame;
  66.     if (!pFrame->LoadFrame(IDR_MAINFRAME,
  67.                             WS_OVERLAPPED | WS_VISIBLE | 
  68.                             WS_SYSMENU |WS_MAXIMIZEBOX |
  69.                             WS_MINIMIZEBOX))
  70.     {
  71.         return FALSE;
  72.     }
  73.     m_pMainWnd = pFrame;
  74.  
  75.     return TRUE;
  76. }
  77.  
  78. /////////////////////////////////////////////////////////////////////////////
  79. // CAboutDlg dialog used for App About
  80.  
  81. class CAboutDlg : public CDialog
  82. {
  83. public:
  84.     CAboutDlg();
  85.  
  86. // Dialog Data
  87.     //{{AFX_DATA(CAboutDlg)
  88.     enum { IDD = IDD_ABOUTBOX };
  89.     //}}AFX_DATA
  90.  
  91.     // ClassWizard generated virtual function overrides
  92.     //{{AFX_VIRTUAL(CAboutDlg)
  93.     protected:
  94.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  95.     //}}AFX_VIRTUAL
  96.  
  97. // Implementation
  98. protected:
  99.     //{{AFX_MSG(CAboutDlg)
  100.         // No message handlers
  101.     //}}AFX_MSG
  102.     DECLARE_MESSAGE_MAP()
  103. };
  104.  
  105. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  106. {
  107.     //{{AFX_DATA_INIT(CAboutDlg)
  108.     //}}AFX_DATA_INIT
  109. }
  110.  
  111. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  112. {
  113.     CDialog::DoDataExchange(pDX);
  114.     //{{AFX_DATA_MAP(CAboutDlg)
  115.     //}}AFX_DATA_MAP
  116. }
  117.  
  118. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  119.     //{{AFX_MSG_MAP(CAboutDlg)
  120.         // No message handlers
  121.     //}}AFX_MSG_MAP
  122. END_MESSAGE_MAP()
  123.  
  124. // App command to run the dialog
  125. void CNettoolsApp::OnAppAbout()
  126. {
  127.     CAboutDlg aboutDlg;
  128.     aboutDlg.DoModal();
  129. }
  130.  
  131. /////////////////////////////////////////////////////////////////////////////
  132. // CNettoolsApp commands
  133.